From 3864e5b1c6e720e103f35a0aaddd25fb3142e605 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Wed, 19 Aug 2020 09:57:57 -0600 Subject: [PATCH] Allow plugin view & configuration files to be registered on protected routes Fixes #5245 --- modules/system/classes/PluginManager.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index e5a9b590e..d5caf21cb 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -238,18 +238,6 @@ class PluginManager 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 @@ class PluginManager 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 */