Skip to content

Commit

Permalink
Allow plugin view & configuration files to be registered on protected…
Browse files Browse the repository at this point in the history
… routes

Fixes #5245
  • Loading branch information
Luke Towers committed Aug 19, 2020
1 parent f295620 commit 3864e5b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions modules/system/classes/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down

0 comments on commit 3864e5b

Please sign in to comment.