Creating a new revision of an entity resets revision_timestamp on other revisions

Created on 17 April 2017, about 7 years ago
Updated 30 January 2024, 5 months ago

Hi,

I have a (private) module that basically does this:

$entity = EntityTypeManager::getStorage('node')->load(...);
/* Set some fields */
$entity->setNewRevision(true);
$enttiy->save();

With the expectation that it would update a couple of fields, create a new entity, and then save said entity with a new revision and its own revision_timestamp reflecting when that revision is made.

The problem is that this has a side effect: it's updating the revision_timestamp of all other revisions of this entity to that of the latest one, effectively clobbering all of my revisions to reflect the latest revision time, losing any record of when all earlier revisions were actually created.

Am I missing a step somewhere and this is intended behavior, or is this an oversight?

πŸ’¬ Support request
Status

Closed: outdated

Version

9.5

Component
EntityΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΊπŸ‡ΈUnited States kevans91

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.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Can you reproduce this on a vanilla install of Drupal core?

    If so can you add more steps to reproduce.

    This isn't the default behaviour so I suspect something else might be in the mix here.

  • Status changed to Closed: outdated 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Since there hasn't been a follow up going to close for now.

Production build 0.69.0 2024