I know that content entities should be translatable. However, there are situations it is not. For example, the Profile module decided to make its entities nontranslatable - I hope they change it here.
To allow entities like these to be synchronized, the Entity Share module should not require a language to be set for the content.
Comments
Comment #2
dbiscalchin commentedA patch that makes the module work with entities that do not have a language code.
I've also fixed a part of the code where the "langcode" key was not being verified - it was assumed that it would be "langcode", but it may vary for different entity types.
Comment #3
dbiscalchin commentedThe previous patch was not working for updates of nontranslatable entities.
Comment #4
grimreaperHello,
Thank you very much for opening this issue.
With Drupal 8 and the new multilingual API, I didn't imagine untranslatable entities (and therefore entities without langcode).
I will not merge or test your patch because #2939827: Provide a supported API for entity denormalization has a higher priority. And so I will wait for it to be done before checking your issue.
Also changing the status to needs review as there is a patch and puting a higher priority.
Comment #5
dbiscalchin commentedSending a new patch, because sometimes the "langcode" key comes as an empty string.
Comment #6
grimreaperComment #7
grimreaperHello,
@dbiscalchin, thanks for the patch.
Unfortunately, as the patch is old it can't be appliable anymore. I looked into the patch and I think some implementation can lead to side effects.
Here is a patch with a new implementation. Testing, with the profile entity from https://www.drupal.org/project/profile, I also fixed the problem of an entity without 'label' entity key.
Also during my testing with a profile entity, I had to add:
because I think it was a computed field which can't be handled by FieldItemNormalizer.
I will try to create a dedicated untranslatable entity for test and also to write a test.
Meanwhile, this patch allows to unlock the situation on entity share 8.x-2.x.
Comment #8
grimreaperPatch with the automated tests and the fix which should be green.
Patch with the automated tests only which should be red.
Comment #11
grimreaperMerged!