Skip to content

get nested elements for all localised owners#18702

Merged
brandonkelly merged 3 commits into5.xfrom
bugfix/18691-nested-element-revisions
Apr 14, 2026
Merged

get nested elements for all localised owners#18702
brandonkelly merged 3 commits into5.xfrom
bugfix/18691-nested-element-revisions

Conversation

@i-just
Copy link
Copy Markdown
Contributor

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

Description

In v5.9.0, the before prepare element query for matrix field started calling $query->owner($owner) as opposed to $query->ownerId = $owner->id (686acd93cc#diff-b69a116794c7e46c0ab7429df36ab933f3ff5071e8e1856aa27cf9de2c4b1b40L778).

This change made significant performance improvements, but it looks like it has some adverse effects when combined with certain propagation settings. The NestedElementQueryTrait::owner() method will set the query’s siteId to the owner’s siteId and ignore any other siteId param that was previously configured on the query.
In the case described by OP, it means that when creating revisions, the nested elements are only found on the owner’s site, and any nested elements unique to other sites supported by the owner are ignored.

Fix:
When getting nested elements in the NestedElementManager::createRevisions() method, first get the owner element across all supported sites, then get the nested elements for each site individually.

Related issues

#18691

@i-just i-just requested a review from brandonkelly April 14, 2026 08:42
@brandonkelly brandonkelly merged commit a6b1d72 into 5.x Apr 14, 2026
2 checks passed
@brandonkelly brandonkelly deleted the bugfix/18691-nested-element-revisions branch April 14, 2026 14:27
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