diff --git a/CHANGELOG.md b/CHANGELOG.md index 1de2f6d38..78eebf68e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Fixed `Flex Pages` not updating empty content on save [#2890](https://github.com/getgrav/grav/issues/2890) * Fixed creating new Flex User with file storage * Fixed saving new `Flex Object` with custom key + * Fixed broken `Plugin::config()` method # v1.7.0-rc.8 ## 03/19/2020 diff --git a/system/src/Grav/Common/Plugin.php b/system/src/Grav/Common/Plugin.php index 6ab12eb1a..90b0a0313 100644 --- a/system/src/Grav/Common/Plugin.php +++ b/system/src/Grav/Common/Plugin.php @@ -91,10 +91,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess */ public function config() { - if (is_array($this->config)) { - return $this->config["plugins.{$this->name}"]; - } - + return null !== $this->config ? $this->config["plugins.{$this->name}"] : []; } /** diff --git a/system/src/Grav/Framework/Flex/FlexIndex.php b/system/src/Grav/Framework/Flex/FlexIndex.php index 61526ac97..c8e66254d 100644 --- a/system/src/Grav/Framework/Flex/FlexIndex.php +++ b/system/src/Grav/Framework/Flex/FlexIndex.php @@ -70,11 +70,17 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde } /** + * You can define indexes for fast lookup. + * + * Primary key: $meta['key'] + * Secondary keys: $meta['my_field'] + * * @param array $meta * @param array $data */ public static function updateObjectMeta(array &$meta, array $data) { + // For backwards compatibility, no need to call this method when you override this method. static::updateIndexData($meta, $data); }