Closed (duplicate)
Project:
Paragraphs Asymmetric Translation Widgets
Version:
8.x-1.0-beta1
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
26 Feb 2019 at 17:17 UTC
Updated:
6 Dec 2023 at 09:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
pbonnefoi commentedI fixed my problem adding these lines (see patch).
In my case, the content was already translated so I got the translation prior to duplicate the paragraph. Great module BTW.
Comment #3
pbonnefoi commentedComment #4
pbonnefoi commentedComment #5
mlkstff commentedI had the same problem and the patch from #2 worked for me. Thank you very much!
Comment #6
weseze commentedSeems to me like you experienced an issue by switching from the patch to this module, but having created or updated content without having set up translation correctly for your paragraph field.
Can you please provide exact steps to reproduce this issue?
Once correctly setup this error should never appear. Content migration after switching settings is not supported and the patch you provided is basically a workaround for broken content...
Comment #7
pbonnefoi commented@weseze Actually, the patch has the same issue with my case. Here it is :
A Drupal 8 with 6 languages was built a while ago with paragraph set wrongly to translatable. Then the client created all the node and their translation. So far no problem. Then They wanted to delete some paragraph and lead to the problem we all know with Paragraph and translation. I looked on Internet to avoid this problem without having to re-contribute all the content. I found the patch and then the module. I thought I fixed my problem as I was focusing on being able to add or remove a paragraph on any language. But I wasn't paying attention that the language wasn't the right one. Then I looked into the module to see what was wrong and I notice that in my case, the paragraphs translated weren't loaded if already in the database prior to display in the eddit mode. Then I added the patch I created here and my problem was solved for good. I hope this helps. According to me, my patch isn't doing much and not occurring any regression for any other case. I'm glad it already solved @mlkstff problem as well.
PMLK if you need more input (and sorry for my late answer).
Comment #8
weseze commented@pbonnefoi Thanks for the extra info.
As I suspected this is an issue with paragraphs content that was created before implementing the widget from this module. In theory you should delete all your translations prior to installing this module and retranslate after setting it up. Not doing so will result in a lot of "stale" paragraphs in your database.
The use case for migrating paragraphs from one system to the other is not supported and would be a very big task indeed...
The patch from #2, will (I think) not actually fix the issue, but rather "mask" it by duplicating your old translation. So you are probably left with 2 paragraphs per translation by using this patch. One from before using this module, which will become a stale paragraph, no longer used anywhere. And 1 duplicated paragraph which you will be seeing and editing.
While this patch will actually resolve your issue it will also create a huge mess of stale paragraphs and field data in your database. But you would need to actually confirm that for me since I don't have any setup with this configuration to test on...
I've attached a patch, which I think will still solve your issue, but prevent this duplication mess. Can you test it and confirm it works? Could you also dive into the database and figure out if the previous patch left stale paragraphs? (and this patch doesn't?)
Comment #9
tancWe're also seeing this exact issue when a translation is created before the widget is changed. The latest patch provides a good workaround. We're now trying to establish whether its possible to delete the translations and clean up the database that way, then recreate them. Or whether there will still be 'stale' rows in the db.
Comment #10
colorfieldConfirming that #8 patch works / database looks fine. Re-rolled on 8.x-1.x / 1.0-beta-2. Perhaps we could still have another review?
I came here from a TMGMT setup, documenting for others that might have meet this, with the steps to reproduce.
- Given a node EN source, and DE translation done via TMGMT
Behaviour:
- The DE frontend is displaying the DE translation
- The DE edit form is displaying the EN source
- Cannot be reproduced while doing a manual translation
- Switching the form display to 'Paragraphs classic' displays the right translation on edit form
- Applying the patch from #8 / #10 solves the issue
Comment #11
gantal commentedTagging for DrupalCamp Colorado's upcoming contrib day.
Comment #12
praveenpb commentedThe patch #10 resolved the issue.
Comment #13
praveenpb commentedComment #14
weseze commentedSetting back to "needs work".
The concept of async behaviour is that you have different paragraphs in different languages, NOT translations.
Simply loading the translations might look like a fix, but it is not.
You would need to duplicate the paragraph with the content from the translation.
Although I do still believe that this is way out-of-scope for the widget.
Switching from sync to async or the other way around requires content to be re-generated (if it exists) This could potentially be a very heavy workload and should not be handled in the widget, but at the time if making the switch.
Also note that switching from async to sync is technically impossible to handle correctly.
Switching from sync to async should be possible.
Comment #15
merilainen commentedThere has been this issue #2992777: Implement a migration path going on "forever".
Comment #16
weseze commentedClosing this as a duplicate of #2992777: there seems to be some good work going on there, will try and check that.