From e28360f86aaa93b40505c47c8cf6db3d6ce60d57 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 27 May 2021 13:17:24 +0300 Subject: [PATCH] Fixed flex pages search using only folder name [#3316] --- CHANGELOG.md | 1 + system/src/Grav/Framework/Flex/FlexObject.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa984ab7f..8818551a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Improve Plugin and Theme initialization to fix PHP8 bug [#3368](https://github.com/getgrav/grav/issues/3368) * Fixed `pathinfo()` twig filter in PHP7 * Fixed the first visible child page getting ordering number `999999.` [#3365](https://github.com/getgrav/grav/issues/3365) + * Fixed flex pages search using only folder name [#3316](https://github.com/getgrav/grav/issues/3316) # v1.7.15 ## 05/19/2021 diff --git a/system/src/Grav/Framework/Flex/FlexObject.php b/system/src/Grav/Framework/Flex/FlexObject.php index b65e5aeab..d505e5603 100644 --- a/system/src/Grav/Framework/Flex/FlexObject.php +++ b/system/src/Grav/Framework/Flex/FlexObject.php @@ -298,7 +298,11 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface $weight = 0; foreach ($properties as $property) { - $weight += $this->searchNestedProperty($property, $search, $options); + if (strpos($property, '.')) { + $weight += $this->searchNestedProperty($property, $search, $options); + } else { + $weight += $this->searchProperty($property, $search, $options); + } } return $weight > 0 ? min($weight, 1) : 0;