]> git.mxchange.org Git - friendica.git/commitdiff
Install selected theme during settings persistence.
authorAndreas Neustifter <andreas.neustifter@kapsch.net>
Fri, 27 Apr 2018 18:45:34 +0000 (20:45 +0200)
committerAndreas Neustifter <andreas.neustifter@kapsch.net>
Fri, 27 Apr 2018 18:45:34 +0000 (20:45 +0200)
Themes have to be installed to be usable by the system. This is not done
automatically which lead to the problems with the site when themes where
switched right after the install and before the "Reload themes" button
was pressed in the admin page.

This patch makes sure that the selected them is always installed when
it is selected by the user either in the admin or settings page.

Fixes #4921.

mod/admin.php
mod/settings.php

index 7749cff6dcd3be23fb95a79e2ae5f294beb03964..3090376bea5b4453c33b77c3d49676c5280e0c23 100644 (file)
@@ -1120,6 +1120,7 @@ function admin_page_site_post(App $a)
        }
        Config::set('system', 'language', $language);
        Config::set('system', 'theme', $theme);
+       Theme::install($theme);
 
        if ($theme_mobile == '---') {
                Config::delete('system', 'mobile-theme');
index aec2b2a0501d8f8eb7a9a12ce045eab88f8ffd76..3102fef2335d82b5d5f06ff17725d4b9bf6034ac 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
+use Friendica\Core\Theme;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 use Friendica\Model\Contact;
@@ -354,6 +355,7 @@ function settings_post(App $a)
                                theme_post($a);
                        }
                }
+               Theme::install($theme);
 
                $r = q("UPDATE `user` SET `theme` = '%s' WHERE `uid` = %d",
                                dbesc($theme),