cms icon indicating copy to clipboard operation
cms copied to clipboard

[3.x]: All Neo blocks duplicated on an entry

Open weotch opened this issue 3 years ago • 2 comments

What happened?

Description

We've seen a number of cases of all the Neo blocks on an Entry being duplicated. We've been able to recover from this issue by going back to an older version from before the duplication occurred and choosing "Revert content from this revision".

Steps to reproduce

I haven't been able to find a clear way to reproduce this, but I do have a database sql export from after the most recent time it happened if that can assist in troubleshooting. I observed this happening today when I:

  1. Went to an entry and chose "Add a site" (the Section is set to "Let each entry choose which sites it should be saved to").
  2. Enabled the entry in the new site via the sidebar (the Default Status for the site is disabled)
  3. Saved the entry

In the new revision that was created after the save, not only were the blocks duplicated, a Redactor field's value had reverted to a previous revision's state. I suspect the issue is that my CMS user had a draft version of the entry that was old and when Craft tried to merge the current state with mine, it:

  • Saw the my olds and the new blocks as different and concatenated them rather than updating them
  • Chose my value for that Redactor field rather then the newer value from the server

Expected behavior

No duplication of blocks.

Actual behavior

All Neo blocks are duplicated, maintaining their original order. See this screenshot:

duplicated-blocks

Craft CMS version

3.7.39

PHP version

7.4.29

Operating system and version

Darwin 21.4.0

Database type and version

MySQL 8.0.29

Image driver and version

GD 7.4.29

Installed plugins and versions

Colorit 1.1.2.1
Control Panel CSS 2.4.0
Control Panel JS 2.4.0
Dashboard Begone 1.0.1
DigitalOcean Spaces Volume 1.1.3
Documentation 2.1.2
Feed Me 4.5.0
Importable Shopify Feeds 1.3.1
Neo 2.13.5
Redactor 2.10.7
Sentry 1.5.1
Super Table 2.7.1
Translations 2.7.1
Webhooks 2.4.1

weotch avatar May 17 '22 19:05 weotch

Are you able to reproduce this with a Matrix field? If not, it may be Neo-specific, and would need to be reported at https://github.com/spicywebau/craft-neo/issues/ instead. Either way, we (or Spicy Web) will need some reliable steps to reproduce, before we can look into it.

brandonkelly avatar May 18 '22 19:05 brandonkelly

First sorry for the info dump ha, we are still in the process of trying to reproduce this.

We have seen this occur with Matrix fields, Super Table and Neo. We haven't been able to reproduce locally but it has happened multiple times on different sites over the last few months. In some cases static Super Table blocks have been duplicated, in others all the Matrix blocks or Neo blocks on an entry were duplicated and in one case a static Super Table had been removed completely.

We have seen this occur on 3 sites now:

1: CraftCMS version greater then 3.7.20. It started happening after we updated from 3.7.20 to 3.7.34 and continued happening after updating to 3.7.46. Super Table: 2.7.1 Neo: 2.13.12 Multi-site: No. On 24 entries of the same section type all Super Table blocks were duplicated. This also occurred a single time on another section type. This occurred at various times over the last few months after the update to 3.7.34. We are not sure of the exact trigger as it happened on a clients site and we were only made aware of it recently.
It looks like the duplicated blocks have the same created date as the entries edited date. There also might have been duplicated Neo blocks but not many.

2: CraftCMS version greater then 3.7.3.2. It started happening at some point after updating from 3.7.3.2 to 3.7.38. Super Table: 2.7.1 Multi-site: Yes. On several entries all Matrix blocks and all Super Table blocks were duplicated. It seems like some of the duplicated blocks had old content that had been replaced some time ago. In one case both static super table blocks on the entry had been removed completely despite one of them having required fields (along with being static super tables so the editor could not have removed them).

3: CraftCMS version 3.7.33 Multi-site: No. Neo: 2.12.5 On a single entry all Neo Blocks on the page had been duplicated.

In all of the above cases the fields had a new id and uid. In all instances I looked at in the database the dateCreated and dateUpdated of the duplicate field was identical to the owner entry's dateUpdated

I just found https://github.com/craftcms/cms/issues/11466 what was fixed recently. It might explain 2, but 1 and 3 are not multi-site. and for 1 it continued to happen after updating to 3.7.46

Kethatril avatar Jul 20 '22 00:07 Kethatril

Going to close this in favor of #11609, which @ttempleton suspected may be related.

brandonkelly avatar May 03 '23 12:05 brandonkelly