Replies: 1 comment 1 reply
-
That will happen when applying a draft (whether normal or provisional). Any nested Matrix entries that were initially created for the draft will be duplicated for the canonical owner entry. I’m not sure what would prevent the doubly-nested entries from being duplicated along with them, though… |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A client is struggling with an issue where entries in a nested Matrix field intermittently disappear as they're editing content.
The setup:
This is a single-site build, with a section called "Trips". Trip entries have a Matrix field "Programs", which uses the Cards view mode and has a single entry type "Program". Nested program entries have a Matrix field called "Program Content Blocks". This field uses the inline-editable blocks view mode.
As per the client, what happens is that sometimes after they edit and save a "Trip" entry, some of the previously saved/published nested entries in the "Program Content Blocks" field in some of the nested "Program" entries, will disappear.
Details are scarce at this point and I'm unable to reproduce, so it's unclear if this is a workflow issue or an actual bug (and if so, what the prerequisite actions/circumstances are to trigger that bug) – so I'm holding off on creating an issue until I feel more confident one way or the other.
But: In investigating a "Trip" entry where this had occurred, I realised the following by comparing revisions and looking at the affected (nested) entries in the database, and I'm looking for some guidance in trying to figure out what actually happened:
elementsdatabase table. The timestamp for the "Trip" entry'sdateCreatedrevision and the timestamp for thedateDeletedcolumn for the "old" Program entry are the same, so this definitely happened within the same request. It's my understanding that the canonical ID for nested entries should not change when editing and saving content in a normal way, including applying drafts or similar, so it's unclear to me why the "Program" nested entry somehow became essentially a different entry, when the Trip entry was saved?One additional fact:
If we believe the client that they did not copy/paste/delete/do anything weird to the original "Program", but simply double-clicked it to edit it in its slideout, and then saved the root owner "Trip" entry, then I'm left with the following questions:
- In what circumstances, if any, will an existing nested entry be assigned a new ID in the
elementstable as a result of "normal" content editing in the CP; and the old ID being soft-deleted (i.e. it ends up with a timestamp in thedateDeletedcolumn in theelementstable)- If that is a legitimate thing that could happen, what could be the reason for why Craft apparently fails to duplicate all of the existing nested entries in a Matrix field for that nested entry, in that scenario?
Aside from those questions: for further debugging, I'd appreciate any advice or guidance in terms of what I should look for, where I should look, specific questions to ask the client, etc. to try and figure this one out and ideally, reproduce. The client is essentially saying "I saved the trip and some of the content blocks in one of the programs disappeared" 🤷, but as I'm unable to reproduce or even imagine how that could theoretically happen, I'm kinda stumped.
Beta Was this translation helpful? Give feedback.
All reactions