Editing nested elements when owner is new for site (and still a provisional draft)#15898
Merged
brandonkelly merged 8 commits into5.xfrom Oct 17, 2024
Merged
Conversation
brandonkelly
added a commit
that referenced
this pull request
Oct 20, 2024
ownerId was no longer getting set via setAttributesFromRequest(), after #15898
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 toallsite1with at least 1 nested entry in the matrix field & savesite2- don’t save; stay in the provisional draftsite2and 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