mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed Grav using blueprints and form fields from disabled plugins
This commit is contained in:
parent
1297114b3e
commit
2727f92a53
|
|
@ -11,6 +11,7 @@
|
|||
* Fixed clockwork error when clearing cache
|
||||
* Fixed missing method `translated()` in `Flex Pages`
|
||||
* Fixed missing `Flex Pages` in site if multi-language support has been enabled
|
||||
* Fixed Grav using blueprints and form fields from disabled plugins
|
||||
|
||||
# v1.7.7
|
||||
## 02/23/2021
|
||||
|
|
|
|||
|
|
@ -68,13 +68,21 @@ class Plugins extends Iterator
|
|||
$blueprints = [];
|
||||
$formFields = [];
|
||||
|
||||
$grav = Grav::instance();
|
||||
|
||||
/** @var Config $config */
|
||||
$config = $grav['config'];
|
||||
|
||||
/** @var Plugin $plugin */
|
||||
foreach ($this->items as $plugin) {
|
||||
if (isset($plugin->features['blueprints'])) {
|
||||
$blueprints["plugin://{$plugin->name}/blueprints"] = $plugin->features['blueprints'];
|
||||
}
|
||||
if (method_exists($plugin, 'getFormFieldTypes')) {
|
||||
$formFields[get_class($plugin)] = isset($plugin->features['formfields']) ? $plugin->features['formfields'] : 0;
|
||||
// Setup only enabled plugins.
|
||||
if ($config["plugins.{$plugin->name}.enabled"] && $plugin instanceof Plugin) {
|
||||
if (isset($plugin->features['blueprints'])) {
|
||||
$blueprints["plugin://{$plugin->name}/blueprints"] = $plugin->features['blueprints'];
|
||||
}
|
||||
if (method_exists($plugin, 'getFormFieldTypes')) {
|
||||
$formFields[get_class($plugin)] = $plugin->features['formfields'] ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +91,7 @@ class Plugins extends Iterator
|
|||
arsort($blueprints, SORT_NUMERIC);
|
||||
|
||||
/** @var UniformResourceLocator $locator */
|
||||
$locator = Grav::instance()['locator'];
|
||||
$locator = $grav['locator'];
|
||||
$locator->addPath('blueprints', '', array_keys($blueprints), ['system', 'blueprints']);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user