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

Comments

mbovan created an issue. See original summary.

mbovan’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new948 bytes

This should be enough to fix the bug.

mbovan’s picture

Issue summary: View changes
chr.fritsch’s picture

I tested that patch with our Thunder distribution, and the issue we had, that our default content was not imported properly, is now fixed.

Algeron’s picture

Status: Needs review » Reviewed & tested by the community

Same here - The patch has fixed issues we had with the default_content module.

johnchque’s picture

Status: Reviewed & tested by the community » Needs work

Cannot be RTBC as long as we don't have tests.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.55 KB
new2.47 KB
new1.55 KB

Adding test coverage...

berdir’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Looks good.

The last submitted patch, 7: prevent_duplicate-2848029-4-TEST-ONLY.patch, failed testing.

johnchque’s picture

+1 for commiting it.

  • miro_dietiker committed eb86c27 on 8.x-1.x authored by mbovan
    Issue #2848029 by mbovan, chr.fritsch: Prevent duplicate revisions by...
miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Thx, committed! :-)
Will do another release in a minute...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.