From 28372be98282fbfc54ece2c4dbe86629096c8689 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 15 Feb 2019 22:08:02 +0200 Subject: [PATCH] Fixed bug in Flex collection caching --- system/src/Grav/Framework/Flex/FlexIndex.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Framework/Flex/FlexIndex.php b/system/src/Grav/Framework/Flex/FlexIndex.php index 20732951f..71278c3ca 100644 --- a/system/src/Grav/Framework/Flex/FlexIndex.php +++ b/system/src/Grav/Framework/Flex/FlexIndex.php @@ -218,7 +218,7 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde */ public function getCacheKey() { - return $this->getType(true) . '.' . sha1(json_encode($this->getKeys())); + return $this->getType(true) . '.' . sha1(json_encode($this->getKeys()) . $this->_keyField); } /** @@ -324,7 +324,7 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde try { // If flex collection is returned, convert it back to flex index. if ($result instanceof FlexCollection) { - $cached = $result->getFlexDirectory()->getIndex($result->getKeys()); + $cached = $result->getFlexDirectory()->getIndex($result->getKeys(), $this->getKeyField()); } else { $cached = $result; }