Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication of Super Table field when applying and merging drafts #453

Closed
AlexShearcroft opened this issue Jun 22, 2023 · 6 comments
Closed
Assignees
Labels
priority: high To be merged ASAP type: bug Something isn't working

Comments

@AlexShearcroft
Copy link

We have a multisite (9 sites) Craft built website utilising the translations plugin. We’re experiencing issues with duplication of data – in particular with one static Super Table element which has the propagation method set to "Save blocks to all sites the owner element is saved in". The "section" propagation method is set to "Let each entry choose which sites it should be saved to".

The duplication applied is quite drastic in the production environment with multiple (50+) duplications of this 1 element translated x amount of times – which have been applied, so we have to go through and clean this up via various means.

To replicate the problem:

Plugin Version

Translations 3.2.5
Super Table 3.0.8.1
Craft CMS 4.3.10

Process

  • Raise a new order – Listed 11 source entries (all en-gb), select source site of English(en-gb) with 7 target sites selected.
  • Download the source files in an XML format
  • Upload one translated file with translated content
  • “Review changes” for the entry in question – when looking at the text tab everything looks in working order and translated correctly
  • Next “Merge into draft” and this successfully creates a draft
  • On the orders screen click the entry and see the sidebar of the entry open. Upon review, the translated site version looks correct. If you now open this in the external link (top right) and see the draft in English (en-gb) the supertable field has now been applied twice in English and translated site = wrong.
  • If you then apply the draft it will now have multiple rows for the Super Table field even though it's set to be static – as described above. The top Super Table field is in English and then followed by the translated version – please note the FE does not double up… only the CP entry - but can display the incorrect Super Table field translation (mapping to another version of this field when duplicated multiple times). However, please note the translated version in the CP is working as expected and applies once. But this then breaks and duplicates when further updates are applied after or simultaneously with other merged drafts.
  • A warning is then displayed on the orders listing page mentioning the entry source has now been updated for other languages for this entry.

Update

When changing the propagation method on the Super Table field to "Only save blocks to the site they were created in" - this then works fine going by the above process. However, I wanted to raise this ticket as a concern for anyone who needs to use the propagation methods outlined previously and experiences similar issues.

Please note that even after updating to the latest versions of the 3 above plugins the issue was still present. The only fix was updating the propagation method.

Expected result

Applying new translations not to double up or continually add new CP supertable fields each time.

@MerrittBoydston MerrittBoydston added type: bug Something isn't working priority: high To be merged ASAP labels Jun 22, 2023
@shnsumit
Copy link
Collaborator

@AlexShearcroft Thanks for providing the detailed information here.

We were able to reproduce the same issue with the given steps. It seems an edge case with those specific settings, we are debugging and will fix it as soon as we can.

@bhupeshappfoster
Copy link
Collaborator

bhupeshappfoster commented Jul 3, 2023

@AlexShearcroft

Please upgrade your translations plugin as a new version for translations plugin release3.2.8 has been released that addresses the block duplication issue within our plugin and the blocks will not duplicate when clicking on merge or merge and apply drafts button (This means more than one drafts should not exist at any point of time else we might see some block missing/overwriting issues). However it is advised to create one draft at once and apply it to create other this is because of some issue within the super-table plugin for which a new ticket in super-table repository has been created (verbb/super-table#526) lets have an eye on that for multiple draft issue.

Sorry for the inconvenience caused for the time being the steps for successful publishing of these super-table entries are:

  • After the files are delivered (i.e the file status is ready for review) select one file and click merge into draft button and confirm the changes and then apply the draft if all seems fine.
  • All the files are to be published in same manner as in above step.
  • Another case that can avoid this one by one process is when the files status is ready for review select all files and click merge and apply draft in this scenario multiple drafts does not exist at any time, like a draft is created and applied for each file of an order.

@MerrittBoydston
Copy link
Collaborator

Hi @AlexShearcroft, I wanted to follow up on this ticket. Was the version upgrade able to resolve your duplication issue?

@AlexShearcroft
Copy link
Author

Hi @MerrittBoydston apologies for the delay in response.

I've applied the update to our version and can confirm the Super Table field in question no longer duplicates. However, on my version when I apply further drafts the content that had been translated, reverts back to it's original content and will only apply the latest "merge and apply". For example:

  • Raise an order on an entry in EN-GB
  • Select 3 variant languages as target sites
  • Download and change the content in the field via XML
  • Upload new XML files
  • View draft changes - all look good
  • Apply in one language first, followed by another and then the last version
  • Only the last version applied correctly and all the others reverted back to their original content.

On a side note, in order to apply this update I had to also upgrade my version of Craft from 4.3.10 to 4.4.2.

@bhupeshappfoster
Copy link
Collaborator

Hi @AlexShearcroft

We tried replicating the new issue for unfortunately we didn't saw the issue you faced. Now we are in need of more details like:

  1. Can we confirm it once if the same issue is seen with all entries or a specific section or entry.
  2. The type and structural details of element used for translation when this issue was seen (This seems to an edge case issue).
  3. The steps followed while merging into draft and publishing (including the sequence they were performed in like if all the drafts were created first then applied one by one or a draft was created then applied and so on.)
  4. It will be helpful if you can provide us with the translated files.
  5. Lastly it would be great of we can see that in action at some sandbox server.

@MerrittBoydston
Copy link
Collaborator

Hi @AlexShearcroft , when you have a moment, can you review @bhupeshappfoster's comment about replicating the issue?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high To be merged ASAP type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants