Follow-up to #2801321: New host revisions do not always create new composite entity revisions
Problem/Motivation
As of now, EntityReferenceRevisionsItem::preSave creates a new revision without checking if the host entity is already saved.
It could lead to duplicated revision records...
Proposed resolution
Add a condition into EntityReferenceRevisionsItem::preSave to assert that entity is not new before creating a new revision.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | prevent_duplicate-2848029-4-interdiff.txt | 1.55 KB | mbovan |
| #7 | prevent_duplicate-2848029-4.patch | 2.47 KB | mbovan |
| #7 | prevent_duplicate-2848029-4-TEST-ONLY.patch | 1.55 KB | mbovan |
| #2 | prevent_duplicate-2848029-2.patch | 948 bytes | mbovan |
Comments
Comment #2
mbovan commentedThis should be enough to fix the bug.
Comment #3
mbovan commentedComment #4
chr.fritschI tested that patch with our Thunder distribution, and the issue we had, that our default content was not imported properly, is now fixed.
Comment #5
Algeron commentedSame here - The patch has fixed issues we had with the default_content module.
Comment #6
johnchqueCannot be RTBC as long as we don't have tests.
Comment #7
mbovan commentedAdding test coverage...
Comment #8
berdirLooks good.
Comment #10
johnchque+1 for commiting it.
Comment #12
miro_dietikerThx, committed! :-)
Will do another release in a minute...