Allow plugin autoloaders to load on restricted pages and actions (#5120)
Allow plugin autoloaders to load, even on restricted pages. This allows (enabled) plugins to load their autoloaders on any pages, allowing includes in migration files to run. Fixes #5110.
This commit is contained in:
parent
48a7cc2a89
commit
8dba43ba0b
|
|
@ -224,9 +224,9 @@ class PluginManager
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify that the provided plugin should be registered
|
* Prevent autoloaders from loading if plugin is disabled
|
||||||
*/
|
*/
|
||||||
if (!$plugin || $plugin->disabled || (self::$noInit && !$plugin->elevated)) {
|
if ($plugin->disabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -238,6 +238,13 @@ 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
|
* Run the plugin's register() method
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue