diff --git a/CHANGELOG.md b/CHANGELOG.md index 9690daf92..3d9c73468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ * Upgraded to **composer v2.1.14** for PHP 8.1 compatibility * Added third `$name` parameter to `Blueprint::flattenData()` method, useful for flattening repeating data * `ControllerResponseTrait`: Redirect response should be json if the extension is .json +3. [](#bugfix) + * Fixed bad key lookup in `FlexRelatedDirectoryTrait::getCollectionByProperty()` # v1.7.25 ## 11/16/2021 diff --git a/system/src/Grav/Framework/Flex/Traits/FlexRelatedDirectoryTrait.php b/system/src/Grav/Framework/Flex/Traits/FlexRelatedDirectoryTrait.php index 9f7380c03..37a0070dd 100644 --- a/system/src/Grav/Framework/Flex/Traits/FlexRelatedDirectoryTrait.php +++ b/system/src/Grav/Framework/Flex/Traits/FlexRelatedDirectoryTrait.php @@ -36,7 +36,7 @@ trait FlexRelatedDirectoryTrait /** @var FlexCollection $collection */ $collection = $collection->filter(static function ($object) use ($list) { - return in_array($object->id, $list, true); + return in_array($object->getKey(), $list, true); }); return $collection;