Closed (fixed)
Project:
Translation Management Tool
Version:
8.x-1.x-dev
Component:
Source: Node
Priority:
Major
Category:
Feature request
Assigned:
Reporter:
Created:
16 Nov 2016 at 09:53 UTC
Updated:
25 May 2021 at 12:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
berdirThat is a feature, not a bug.
Paragraphs are part of the host entity, if you translate a node with paragraph fields, they are automatically added there.
Comment #3
jibla commentedUploading the patch.
Comment #4
jibla commentedComment #5
berdirAh, so what you're saying is that saving doesn't work.. that is possible, looking at that code. But then you should clarify the issue title.
Comment #6
jibla commentedComment #7
ademarco commentedYeah the problem is that the default embedded fields are not loaded in \Drupal\wfp_global\Plugin\tmgmt\Source\ContentEntitySource::doSaveTranslations() since only those saved in configuration are:
ContentEntitySource::doSaveTranslations() should instead use:
The patch does just that.
Comment #8
ademarco commentedComment #9
berdirMakes sense, but we need to figure out why our tests aren't catching it. We do have tests, maybe only for extracting, not sure.
Comment #10
miro_dietikerI also once ran into saving issues but wasn't able to reproduce it well... Happy we found this problem.
Promoting since Paragraphs is our reference UX demo case.
Comment #11
ademarco commentedIn tmgmt_demo_install() we run the following:
This actually saves that "entity_reference_revisions" into "tmgmt_content.settings", something that you can never do via the UI. I haven't tried it but I bet that if we remove that part from the hook_install() the demo module would not work anymore.
About tests: the only one I could find that concerns this issue seems to be:
But there we don't test saving a translation but only if the job item can correctly derive a referenced entity (which it can), or where should we look at to find the correct place to test this?
Comment #12
berdirYou are absolutely correct, that line is a left-over of how it worked before and it needs to go.
And yes, this is the right test. We need to test saving a translation as well, so basically, you call $job_item->acceptTranslation() (possibly in a loop, like most other tests too); and then make sure the translation has been saved as expected. Should just require a few additional asserts there.
Comment #13
chandru225 commentedI have a similar issue in D7, has anyone tried in a D7 site to translate paragraphs.
Comment #14
toncic commentedI think we need more test here.
Comment #15
berdirNot sure where you are going with this. As we discussed, you should extend the referenced test method by accepting the translation there, not define a new one.
Comment #16
miro_dietikerChecked the tests quickly and it seems we tried to avoid a test dependency to Paragraphs until now.
Should we add a test combined with Paragraphs?
Comment #17
berdirWe didn't avoid it, it wasn't necessary as we can use the test entity type that behaves and works the same as far as we are concerned. But the main reason for not using paragraphs before was actually that paragraphs wasn't ready yet when this test was written.
Comment #18
toncic commentedI think this is better.
Comment #21
berdirThanks. Remember that test-only patches should always be uploaded first.
Comment #23
chandru225 commentedI have a similar issue in in D7, any suggestions?
Comment #24
roderik de langen commentedAnyone has any idea about getting this patch for D7?
Comment #25
emb03 commentedAny work being done on this? This issue is 4 years old. Did this patch ever get ported into a release of the module?
Comment #26
emb03 commentedYes, our organization needs this feature too. Please expedite.
Comment #27
berdirThis is an issue that has been closed 4 years and yes, this has been released also years ago. Recently we've even extended it to cover other forms of paragraph translation. I don't know if you're asking for Drupal 7 or 8, this won't happen for Drupal 7 unless someone is willing to invest a lot of money (we invested weeks of work in Drupal 8 on paragraphs and tmgmt to make this work). If it is not working for you on Drupal 8 then I suggest you double check your paragraph translation configuration (https://www.drupal.org/docs/contributed-modules/paragraphs/multilingual-...), ensure you can translate paragraphs without TMGMT and if all that works, create a support request with more information.
Comment #28
soul88This issue is about supporting Paragraphs module in D8. Given the life cycle of D7 version, I have some doubts that such support will be added to D7. Though there are some patches in the issue queue you might want to try: https://www.drupal.org/project/tmgmt/issues/2487874#comment-12187132
Here's some proof that the patch works: https://www.drupal.org/project/tmgmt/issues/3144836
Comment #29
emb03 commented@Berdir I will follow the steps you outlined to ensure our paragraphs are being translated correctly to see if that fixes our issue. This is for Drupal 8.9.1. Thanks for the patch.