Skip to content

Commit

Permalink
Fix bug where related element’s descendants were ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
rungta committed Sep 5, 2023
1 parent 3b16600 commit 2cf189c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
));
}

Expand Down

0 comments on commit 2cf189c

Please sign in to comment.