]> git.mxchange.org Git - friendica.git/commitdiff
Fix Addons-Load for StorageManager
authorPhilipp <admin@philipp.info>
Sun, 23 Jan 2022 19:23:44 +0000 (20:23 +0100)
committerPhilipp <admin@philipp.info>
Sun, 23 Jan 2022 19:23:44 +0000 (20:23 +0100)
src/Core/Storage/Repository/StorageManager.php

index 3dcbef651178c9ad8d3bfe8e50110d6bbff8ea98..b05e054d07f4083f69596b918aab0875cd56709d 100644 (file)
@@ -22,6 +22,7 @@
 namespace Friendica\Core\Storage\Repository;
 
 use Exception;
+use Friendica\Core\Addon;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
@@ -93,6 +94,11 @@ class StorageManager
 
                $currentName = $this->config->get('storage', 'name');
 
+               /// @fixme Loading the addons & hooks here is really bad practice, but solves https://github.com/friendica/friendica/issues/11178
+               /// clean solution = Making Addon & Hook dynamic and load them inside the constructor, so there's no custom load logic necessary anymore
+               Addon::loadAddons();
+               Hook::loadHooks();
+
                // you can only use user backends as a "default" backend, so the second parameter is true
                $this->currentBackend = $this->getWritableStorageByName($currentName);
        }