Skip to content

Commit c17c822

Browse files
authored
Merge pull request #18704 from craftcms/bugfix/18693-revisions-and-eagerly
eagerly(), revisions and nested elements
2 parents a6b1d72 + 39837b6 commit c17c822

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Fixed a bug where nested element cards weren’t showing validation errors. ([#18690](https://github.com/craftcms/cms/pull/18690))
66
- Fixed a bug where read-only Matrix fields in Index mode weren’t respecting the Default Table Columns setting. ([#18684](https://github.com/craftcms/cms/issues/18684))
77
- Fixed a bug where nested entries could be lost when reverting content from a revision. ([#18691](https://github.com/craftcms/cms/issues/18691))
8+
- Fixed a bug where nested entries weren’t getting loaded when previewing a revision, if queried with `eagerly()`. ([#18693](https://github.com/craftcms/cms/issues/18693))
89

910
## 5.9.19 - 2026-04-07
1011

src/services/Elements.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3492,9 +3492,11 @@ private function _eagerLoadElementsInternal(string $elementType, array $elements
34923492
$query->offset = null;
34933493
$query->limit = null;
34943494

3495+
// The mapping criteria should take precedence here
3496+
// (see https://github.com/craftcms/cms/pull/18704)
34953497
$criteria = array_merge(
3498+
$plan->criteria,
34963499
$map['criteria'] ?? [],
3497-
$plan->criteria
34983500
);
34993501

35003502
// Save the offset & limit params for later

0 commit comments

Comments
 (0)