Skip to content

eagerly(), revisions and nested elements#18704

Merged
brandonkelly merged 4 commits into5.xfrom
bugfix/18693-revisions-and-eagerly
Apr 14, 2026
Merged

eagerly(), revisions and nested elements#18704
brandonkelly merged 4 commits into5.xfrom
bugfix/18693-revisions-and-eagerly

Conversation

@i-just
Copy link
Copy Markdown
Contributor

@i-just i-just commented Apr 14, 2026

Description

When getting an eager loading map for, e.g. a matrix field, we specify some criteria for the query (https://github.com/craftcms/cms/blob/5.9.19/src/fields/Matrix.php#L1560-L1568).

Those criteria are then merged with the plan’s criteria, which are based on the query’s default criteria: https://github.com/craftcms/cms/blob/5.9.19/src/services/Elements.php#L3495-L3498.

The order in which they’re merged meant that the map criteria were overwritten by the plan’s criteria.

Fix: changed the order of the merged criteria arrays so that the map’s criteria take priority.

Related issues

#18693

@i-just i-just requested a review from brandonkelly April 14, 2026 11:36
@brandonkelly brandonkelly merged commit c17c822 into 5.x Apr 14, 2026
2 checks passed
@brandonkelly brandonkelly deleted the bugfix/18693-revisions-and-eagerly branch April 14, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants