Allow plugin view & configuration files to be registered on protected routes

Fixes #5245
This commit is contained in:
Luke Towers 2020-08-19 09:57:57 -06:00
parent f29562023d
commit 3864e5b1c6
1 changed files with 12 additions and 12 deletions

View File

@ -238,18 +238,6 @@ class PluginManager
ComposerManager::instance()->autoload($pluginPath . '/vendor'); 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 * Register configuration path
*/ */
@ -266,6 +254,18 @@ class PluginManager
View::addNamespace($pluginNamespace, $viewsPath); 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 * Add init, if available
*/ */