Bugfix/16640 drafts and propagation#16649
Conversation
Related to #16649 [ci skip]
|
Nice job! I was curious why this wasn’t a bug in Craft 4. Turns out it was, just harder to reproduce: with the same setup, you have to modify a Matrix block’s nested field and add a new site before the draft gets autosaved. The easiest way to reproduce is using JavaScript. With the Status field expanded to show the site select input, and a Matrix block’s nested Plain Text field selected in the DOM inspector, you can run the following JS code: $($0).val('edit');
$('[aria-labelledby="add-site-label"]').val('2').trigger('change');And then the same buggy code path will occur, and only the modified Matrix block will get propagated to the new site. So I cherry-picked the Matrix fix into 4.x (3c692b4). Then I looked into why the Matrix field’s delta data was getting submitted on both autosave requests in Craft 5, but only the first autosave request in Craft 4 (when editing the entry at a normal human speed). That turned out to be due to a0e98b3: when we’re passing That core bug sortof exists in Craft 4 as well, although it’s inconsequential there. So I fixed on 4.x as well (fbe700f). That leaves just the Link field bug. I’m not sure why we were calling |
Description
Steps to reproduce:
on a clean installation:
siteA,siteB)plainText)myEntryTypeentry type; it should have the default title field and theplainTextcontentBuilderMatrix field, entry type:myEntryType; view mode: inline-editable blocks; propagation: allblog) with an entry type (e.g.article) containing the default title field and thecontentBuilderfield; enable that section for both sites; propagation method: let each entry chooseblogsection forsiteA; add twomyEntryType“blocks”, populate the title and plain text for both; fully save the entry;plainTextfor one of the “blocks”, then, under “status”, enable it forsiteBand fully savesiteBand observe that only the edited “block” was propagatedNote: this was also happening if you turned off autosaving drafts
The issue was further exacerbated by an empty Link field as those were getting marked as modified even if they were not.
It’s also reproducible with a matrix field in cards view mode.
Related issues
#16640