Active
Project:
Drupal core
Version:
main
Component:
entity system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Nov 2017 at 18:36 UTC
Updated:
21 Apr 2022 at 19:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hchonovThis issue is a follow-up of #2837022: Concurrently editing two translations of a node may result in data loss for non-translatable fields, which is critical. I think that this is one is not less important, but I'll let other decide if it is critical as well.
Comment #3
hchonovHere a standalone patch based on #2837022-69: Concurrently editing two translations of a node may result in data loss for non-translatable fields and a full patch containing the one from the other issue.
Comment #5
hchonovOups.. wrong diff ...
Comment #6
hchonovComment #7
hchonovI've added test coverage.
Comment #11
hchonovThe reason for at least some of the test fails is that the default language code of the entity might be altered and the condition to detect a removed translation
!$saved_entity->hasTranslation($saved_entity_langcode) && !$translation->isNewTranslation()is simply not sufficient. Also a bug that we already have is that we iterate over the common translation languages, but if the default language code has changed then we'll skip checking the default translation at all. To cover this case I've added the new methodContentEntityInterface::getOriginalDefaultLangcode().By working on this I've noticed something that we've somehow missed in #2863336: Default revision flag doesn't propagate to all entity translation objects where we've introduced a general test for the cloning of each entity property - the
defaultLangcodeproperty is not shared between the translation objects. I've created a new issue for this as it is a problem on its own - #2922626: Default langcode property changes don't propagate to all entity translation objectsComment #13
matsbla commentedI found 1 issue which I think is maybe similar/related to this. When you add a new translation concurrently as another translation is edited, the EntityChangedConstraintValidator doesn't lock, so this, just as when you removed translations, will revert those changes. I'm not sure if that should be part of this issue or if I should make another issue for it?
Comment #14
plachI'd say let's fix translations once and for all here, unless the fix ends up being completely different, which I doubt :)
Comment #15
matsbla commentedThe same issue goes for when you revert revisions and use "Revert content shared among translations", then there is also no lock and you will revert changes that were made concurrently on those field. I guess in that case there should maybe also be a lock?
Comment #16
matsbla commentedI agree with #2 that this also should be considered as a critical for same reasons as #2837022: Concurrently editing two translations of a node may result in data loss for non-translatable fields.
Comment #19
matsbla commentedComment #22
catchMarking #3087086: [DATA LOSS] Concurrent translation editing lead to data loss as duplicate.
Comment #23
catchWhoops, didn't mean to change status.
Comment #25
joseph.olstadpart of the above patch was committed in #2837022: Concurrently editing two translations of a node may result in data loss for non-translatable fields
I started trying to reroll it until I found that part of this patch was already committed with #2837022: Concurrently editing two translations of a node may result in data loss for non-translatable fields
Then I realized that this issue isn't the issue that I'm trying to resolve
Comment #27
catchComment #30
stephencamilo commentedComment #31
matsbla commented