Skip to content

Commit 971a502

Browse files
committed
Bug-fix.
Changelog excerpt: - When changing the front-end's theme or theme mode at the configuration page, the change wasn't being seen immediately, instead being seen only upon subsequent request to any front-end page; Fixed.
1 parent 5998269 commit 971a502

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
199199
#### Bugs fixed.
200200
- [2025.07.07]: The formatFilesize method wasn't accounting for negative numbers; Fixed.
201201
- [2025.07.26]: Some browsers, in some contexts, were raising errors during request inspection concerning the absence of any X-Content-Type-Options header declaration (though it isn't entirely clear whether this error had any actual effect); Fixed.
202+
- [2025.08.09]: When changing the front-end's theme or theme mode at the configuration page, the change wasn't being seen immediately, instead being seen only upon subsequent request to any front-end page; Fixed.
202203

203204
#### Security.
204205
- [2025.08.09]: Improved the safeguards for getAssetPath.

src/FrontEnd.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,16 @@ public function view(string $Page = ''): void
330330
'FormTarget' => $_POST['phpmussel-form-target'] ?? ''
331331
];
332332

333-
/** Fix for immediate display of freshly updated theme selection. */
334-
if (!empty($_POST['config_frontend_theme']) && !preg_match('~[^a-z]~', $_POST['config_frontend_theme']) && ($_POST['config_frontend_theme'] === 'default' ?: file_exists($this->AssetsPath . $_POST['config_frontend_theme'] . DIRECTORY_SEPARATOR . 'frontend.css'))) {
335-
$FE['theme'] = $_POST['config_frontend_theme'];
333+
if ($Page === 'config') {
334+
/** Fix for immediate display of freshly updated theme selection. */
335+
if (!empty($_POST['config_frontend_theme']) && !preg_match('~[^a-z]~', $_POST['config_frontend_theme']) && ($_POST['config_frontend_theme'] === 'default' ?: file_exists($this->AssetsPath . $_POST['config_frontend_theme'] . DIRECTORY_SEPARATOR . 'frontend.css'))) {
336+
$FE['theme'] = $_POST['config_frontend_theme'];
337+
}
338+
339+
/** Fix for immediate display of freshly updated theme mode selection. */
340+
if (!empty($_POST['config_frontend_theme_mode']) && isset($this->Loader->ConfigurationDefaults['frontend']['theme_mode']['choices'][$_POST['config_frontend_theme_mode']])) {
341+
$FE['theme_mode'] = $_POST['config_frontend_theme_mode'];
342+
}
336343
}
337344

338345
/** Populated by [Home | Log Out] by default; Replaced by [Log Out] for some specific pages (e.g., the homepage). */

0 commit comments

Comments
 (0)