Store revision id in originalRevisionId property to use after revision id is updated

Created on 30 September 2016, about 8 years ago
Updated 12 September 2023, over 1 year ago

Problem/Motivation

After calling $entity->setNewRevision(TRUE) we have no way of knowing what revision id the entity used to be.

Considered a blocker for #2640496: Revision ID in {node} and {node_revision} can get out of sync → which is critical.

Proposed resolution

Set the revision id to an originalRevisionId property in __construct
Update the originalRevisionId on post save
Return the property with getOriginalRevisionId() method

Remaining tasks

Review

User interface changes

none

API changes

Two methods added to ContentEntityBase and ContentEntityInterface

Data model changes

None

(Blocking #2809123: Reverting a revision doesn't keep moderation state → )

🐛 Bug report
Status

Fixed

Version

8.3 ⚰️

Component
Entity  →

Last updated about 3 hours ago

Created by

🇬🇧United Kingdom timmillwood 🏴󠁧󠁢󠁷󠁬󠁳󠁿 Wales, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024