In SqlContentEntityStorage the revision_log, revision_timestamp and revision_uid are marked as revision metadata fields, which means they cannot be translatable.
The revision_log is only used by two entities: Node and BlockContent. Only on the node entity it is marked as translatable.
This causes a problem in the following use case:
- create a node entity in english translation
- add a german translation to it
- edit the german translation and set a revision_log while on the german translation
- save the entity
- load the entity
- the revision log message is missing on both translations
So the revision_log on the node entity should be marked as untranslatable.
I have attached a patch for this issue.
Comments
Comment #1
hchonovComment #2
penyaskitoMakes sense to me, good catch!
I don't see any use case where we could want to translate the revision log.
Can you provide a failing test?
Comment #3
gábor hojtsyI agree this looks good. Not 100% sure how would this be tested? Retrieve the metadata of the node fields and verify the revision log is not translatable looks fine to me.
Comment #4
maxocub commentedIs it sufficient to test that revision_log is not translatable or should we test that revision_log is not lost after editing the translation of a node?
Comment #11
maxocub commentedSeems like making the revision log not translatable now breaks quickedit. Concurrently editing a node with the full form and the quickedit form doesn't throw an error.
I'm trying to reproduce this bug and the expected behavior from the UI and I haven't succeeded yet.
Comment #12
RavindraSingh commentedComment #13
RavindraSingh commentedI just want to make sure if I update
->setTranslatable(TRUE) to FALSEthen if throws the error or not. then I will add the tests. I have run the tests on local. it got passed.Comment #15
hchonovI made some testing and actually found the commit since which the QuickEditLoadingTest::testConcurrentEdit fails if we set the node revision_log as non translatable.
Reverting to the commit previous to #2428795: Translatable entity 'changed' timestamps are not working at all makes the test pass.
Comment #16
hchonovAnd more specifically the problem occurs since the changes in ChangedItem::preSave
Comment #17
hchonovAnd the problem is that the ChangedItem now has a new logic -> it checks if the entity has changed and only in this case will update the changed timestmap. But in the test we open the node edit page and save the the node without any changes => which does not update the changed timestamp and so there was no concurrent edit.
Uploading a patch which should pass now.
Comment #18
hchonovAnd here the patch with the test included.
Comment #19
hchonovComment #20
plachLooks good to me, thanks!
Comment #21
hchonovPostponing on #2506213: Decide how the changed timestamp should behave on UI save as the change I made in the test might not be neccessary for the entity to be updated and before commiting such a change it should first be decided what to do when posting an entity form without any changes. The test change might or might not be neccessary.
Comment #22
gábor hojtsyThere is no movement on #2506213: Update content entity changed timestamp on UI save for over a month, so removing from sprint :/
Comment #23
mkalkbrennerDue to the fact that that #2506213: Update content entity changed timestamp on UI save is RTBC and #2465907: Node revision UI reverts multiple languages when only one language should be reverted is affected by this issue I set this one back to "Needs Review"
Comment #24
plachMissing empty line after closing brace.
I think this can be removed now.
Comment #25
hchonov@plach:
1. added an empty line.
2. yes, since #2506213: Update content entity changed timestamp on UI save was just commited the change in the QuickEditLoadingTest is not needed anymore.
Comment #26
plachTrailing white-space, we cannot let that sneak in, sorry :)
Comment #27
plachRemoved the white space, no credits, please.
Comment #28
plachComment #29
gábor hojtsyBring it back on sprint for tracking then :)
Comment #30
plachThis looks majorish
Comment #31
alexpottComment #32
alexpottCommitted 4a99201 and pushed to 8.0.x. Thanks!
Comment #34
gábor hojtsySuperb, thanks all!
Comment #36
maxocub commentedComment #37
maxocub commented