Editing nested elements when owner is new for site (and still a provisional draft) #15898
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Replication steps:
custom
(let each entry choose) & an entry type with a matrix field in cards view mode, propagation set toall
site1
with at least 1 nested entry in the matrix field & savesite2
- don’t save; stay in the provisional draftsite2
and try to open the nested entry - you’ll get an error: “Invalid owner ID”Problem:
The ownership of the nested elements is grabbed and assigned correctly when displaying the owner element, but when you double-click on the card (or use the Edit entry action), only the primary ownership data is taken into consideration, but the primary owner (the canonical element) doesn’t yet exist for that site - only the provisional draft does.
Solution:
Since we have the right owner data when displaying the page, add it to the card’s data attributes (along with field id) and use it when initialising the element editor and querying for the element.
Related issues
n/a