super-table icon indicating copy to clipboard operation
super-table copied to clipboard

Duplicate of content

Open vviacheslavv opened this issue 3 years ago • 20 comments

Description Hello. For frontpage entry type we use super table field type(contains plain text and entries) and in some cases (i can't reproduce it at any time, but it appear from time to time) after publish of entry attribute got 2-3 rows of duplicates. Settings for this attribute has limitation to 1 row max and enabled checkbox "Static". Is there a chance that you may suppose possible reason of such issue ? Thanks

  • Plugin version: 2.7.0
  • Craft version: Pro 3.7.25.1
  • Multi-site: Yes

Additional context

vviacheslavv avatar Feb 08 '22 13:02 vviacheslavv

Hi, we're also experiencing this after updating to CraftCMS 3.7.33 and Super Table 2.7.1

bjornbjorn avatar Feb 18 '22 12:02 bjornbjorn

Strange, but after upgrade to 2.7.1 version this issue has disappeared for me.

vviacheslavv avatar Mar 09 '22 15:03 vviacheslavv

I started seeing this issue after updating to CraftCMS 3.7.34 and Super Table 2.7.1 without multi-site (and it continued happening after updating to CraftCMS 3.7.46 and Super Table 2.7.2)

I have seen it on 25 different pages now and 24 of them on the same section type. It happens on 2 different static Super Tables on the same page and I think on all of them it has been both fields that have duplicated. I do have one draft that has 3 of each field while the published entry only has 2. Because of that my guess is it might be happening on draft creation or when updates to the entry are merged into an existing draft. However I have yet to reproduce the issue locally.

I've also seen this happen with Craft Neo, so it might be a CraftCMS issue. I haven't seen it happen with matrix fields yet though.

Kethatril avatar Jul 14 '22 21:07 Kethatril

Confirm. A Week ago we have got duplicates again. For the same "single" type . Entry has two drafts, one from april and another one from january(if this is important). Plugin version: 2.7.1 Craft version: Pro 3.7.25.1

vviacheslavv avatar Jul 15 '22 08:07 vviacheslavv

This has occurred to us on a different site as well now. Both a static super table and all the matrix blocks on a page were duplicated.

I'm thinking it might be a core CraftCMS issue as I've seen it on Super Table, Neo and Matrix fields now all on a variety of sites.

Kethatril avatar Jul 18 '22 05:07 Kethatril

I've encountered this issue as late as today. Super Table field set as static appeared with duplicate. Do we know anything more about this?

clieee avatar Aug 31 '22 12:08 clieee

We're also experiencing this issue. It appears to be pulling old versions of the Super Table content from old drafts and revisions. It's happening intermittently, hard to reliably reproduce.

stevehurst avatar Sep 26 '22 15:09 stevehurst

We're also seeing this issue. Updating an older entry with a super table field inside a matrix field caused the 3 super table blocks inside the matrix block to be duplicated, so there are now 6 super table blocks. Interestingly, the blocks were duplicated in place, so the duplicates are next to each other. Same as everyone, I can't reliably reproduce it.

MoritzLost avatar Oct 04 '22 10:10 MoritzLost

This should be fixed in 3.0.2, but let me know if there's still issues.

engram-design avatar Oct 27 '22 00:10 engram-design

@engram-design we're not able to update to Craft 4 yet—waiting on 3-4 plugins. We really need a fix for this on the 2.x branch.

This bug is causing critical content issues on our websites. Fields are duplicated and matrix fields are moved automatically when the user loads an entry. If they don't discard changes and save with the mixed up and duplicated content, we're unable to revert fully or fix static Super Table fields that have duplicated.

stevehurst avatar Oct 28 '22 17:10 stevehurst

We also cannot upgrade to Craft 4.x due to other plugins - any chance we'd see a fix in the 2.x branch?

mattbloomfield avatar Nov 14 '22 17:11 mattbloomfield

@engram-design has this been fixed in version 2.7.4, released end of December? Not seeing anything in the change log about this particular issue.

https://github.com/verbb/super-table/releases/tag/2.7.4

stevehurst avatar Jan 16 '23 20:01 stevehurst

We cannot reproduce this reliably yet, but unfortunately we experience the same problem on Version 3.0.7 & Craft CMS 4.3.6.1

EDIT: Authors also reported this behavior on a Matrix Field. Maybe there's an edge cases which can cause relations to double? I'm still working on a way to reproduce reliably.

(Authors edit in a slideout -> save -> all rows duplicate)

maxstrebel avatar Jan 17 '23 15:01 maxstrebel

@stevehurst Not yet, the changes aren't 1-for-1 going back to Craft 3, but I'll do my best to address it.

engram-design avatar Jan 19 '23 13:01 engram-design

@engram-design We're still seeing this issue on Super Table 3.0.7 (Craft 4.3.6.1). We can't reliably reproduce it, it only sometimes happens in production, seemingly randomly. Some content is saved, then all Super Table blocks are duplicated. Any idea why this might still be happening?

MoritzLost avatar Feb 15 '23 10:02 MoritzLost

If we set min rows = 1 and max rows = 1 instead of static, will this fix it? When it's static we don't get the option to [x] out the extra row and can only recreate the component

gbowne-quickbase avatar Apr 18 '23 16:04 gbowne-quickbase

Just got a client report about this issue again. An entry with a matrix block with a super table field inside it. Last saved in April, then a couple of days ago. The revision from April had three super table blocks inside the matrix block, the revision from three days ago had six, each of the original elements was duplicated once. The new blocks got new IDs and were visible in the backend as well, so it wasn't just a frontend issue.

@engram-design Any ideas as to what might be causing this, or how we could help debug / reproduce the issue? I'm completely stuck as it occurs seemingly randomly, and only rarely.

MoritzLost avatar Aug 16 '23 13:08 MoritzLost

I can't tell why it's happening, but I figured out a query that can help to identify such rows.

Select elements.id, so.ownerId  from elements 
    left join supertableblocks s2 on s2.id  = elements.id
    left join stc_navsetting sn on sn.id = elements.id
    left join supertableblocktypes s  on s.id  = s2.typeId 
    left join supertableblocks_owners so on so.blockId  = s2.id
    where type = 'verbb\\supertable\\elements\\SuperTableBlockElement' and 
    elements.archived=FALSE AND elements.dateDeleted IS NULL AND elements.draftId IS NULL AND elements.revisionId IS NULL
    and s.id = ${SUPERTABLEBLOCKTYPE} order by so.ownerId  ASC, elements.id ASC

Now if we know that ${SUPERTABLEBLOCKTYPE} should be static, only 1 element should be attached to it. Now this query shows where two different elements have the same owner, there is a duplicate.

image

yannkost avatar Apr 26 '24 12:04 yannkost

I've seen this with a supertable field and matrix on Craft 4.8.1 when creating a Draft entry for the first time.

This seems to happen if you have autosave drafts on and you hit save while autosave is still processing. We have a bunch of matrix fields and we also have Workflow and some custom events. It's more of an issue when we are creating drafts for the first time with a step 1 workflow user, as the autosave takes longer.

Solutions:

  1. Don't hit save until any autosave completes what it is doing and you get the green check.
  2. Disable autosaveDrafts. Deprecated in Craft 4, but currently we disable it in config. If you are using Fluent config, then before returning it disable it since the ENV override no longer works: $config->autosaveDrafts = false;
  3. Add some code to prevent saving if autosave is running.

Not sure where the fix would be (plugins, craft, etc) at this point, but #3 seems ideal to me as someone could have a network condition on autosave drafts or slower events.

joshmcoffman avatar May 16 '24 19:05 joshmcoffman

If anyone wants a simple way of sorting this on an actual entry in the CMS, you can just go to the super table field in question, fire up the entry edit form in your browser, open the browser inspector and remove the extra supertable node instances and then hit save on the entry. Next time you edit it, you'll only see the one field.

johnwbaxter avatar Jun 11 '24 13:06 johnwbaxter