Skip to content

Fix PHP error when merging canonical changes for non-change-tracking#19187

Open
lukeholder wants to merge 1 commit into
5.xfrom
bugfix/merge-nested-element-that-doesnt-track-changes
Open

Fix PHP error when merging canonical changes for non-change-tracking#19187
lukeholder wants to merge 1 commit into
5.xfrom
bugfix/merge-nested-element-that-doesnt-track-changes

Conversation

@lukeholder

@lukeholder lukeholder commented Jun 30, 2026

Copy link
Copy Markdown
Member

Description

When a draft owner (e.g. a product) had outdated nested elements that returned false from trackChanges(), NestedElementManager would call Elements::mergeCanonicalChanges() on them, which throws unconditionally for elements that don't track changes.

The fix branches on trackChanges(): elements that support it get the full merge, and those that don't have dateLastMerged stamped so they're no longer considered outdated.

Not sure this is the right fix, or if variants should really support tracking changes somehow going forward.

Related issues

Potential fix for Commerce issue craftcms/commerce#4323

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.

1 participant