diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bc29d6..3f027fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ Release notes for the Router Craft CMS plugin. +## Unreleased + +### Fixed +- Fixed a bug where an element's descendants were incorrectly passed to the `relatedTo` criteria. + + + ## 1.4.0 - 2023-02-22 ### Added diff --git a/src/controllers/DefaultController.php b/src/controllers/DefaultController.php index 0c10d00..92bcdcc 100644 --- a/src/controllers/DefaultController.php +++ b/src/controllers/DefaultController.php @@ -282,7 +282,7 @@ public function actionIndex(string $template, array $variables = [], array $filt if ($includeDescendants) { $relatedTo['element'] = array_filter(array_merge( $relatedTo['element'], - array_column($relatedTo['element'], 'descendants') + ...array_column($relatedTo['element'], 'descendants') )); }