diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index e5a9b590e8..d5caf21cbe 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -238,18 +238,6 @@ public function registerPlugin($plugin, $pluginId = null) ComposerManager::instance()->autoload($pluginPath . '/vendor'); } - /** - * Disable plugin registration for restricted pages, unless elevated - */ - if (self::$noInit && !$plugin->elevated) { - return; - } - - /** - * Run the plugin's register() method - */ - $plugin->register(); - /* * Register configuration path */ @@ -266,6 +254,18 @@ public function registerPlugin($plugin, $pluginId = null) View::addNamespace($pluginNamespace, $viewsPath); } + /** + * Disable plugin registration for restricted pages, unless elevated + */ + if (self::$noInit && !$plugin->elevated) { + return; + } + + /** + * Run the plugin's register() method + */ + $plugin->register(); + /* * Add init, if available */