From 225a37af9a111f3565c7ee315e14aec7866680ef Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 12 Mar 2021 18:21:50 +0100 Subject: [PATCH] Installer: install themes as last action this will register theme hooks --- src/Module/Install.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Module/Install.php b/src/Module/Install.php index 95644ae625..2a9bab81ec 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -26,6 +26,7 @@ use Friendica\BaseModule; use Friendica\Core; use Friendica\Core\Config\Cache; use Friendica\Core\Renderer; +use Friendica\Core\Theme; use Friendica\DI; use Friendica\Network\HTTPException; use Friendica\Util\BasePath; @@ -162,6 +163,16 @@ class Install extends BaseModule } self::$installer->installDatabase($configCache->get('system', 'basepath')); + + // install allowed themes to register theme hooks + // this is same as "Reload active theme" in /admin/themes + $allowed_themes = Theme::getAllowedList(); + $allowed_themes = array_unique($allowed_themes); + foreach ($allowed_themes as $theme) { + Theme::uninstall($theme); + Theme::install($theme); + } + Theme::setAllowedList($allowed_themes); break; }