Set proper origin on bulk update

Created on 18 May 2023, over 1 year ago

Steps to reproduce

Consider scenario:
1. Create entity with "Title A". (default)
2. Create draft of the entity, change title to "Title B". (latest, but not default)
3. On bulk edit update title to "Title A" and save.

This generates strange results on revisions tab.

Problem/Motivation

In scenario above, during bulk operation active entity is loaded (from point 2.). But on save, \Drupal\Core\Entity\EntityStorageBase::doPreSave() sets $entity->origin to default revision (so version from point 1.). This is not correct, $entity->origin should be set to draft revision (latest one) of the entity (from point 2.).

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇵🇱Poland gugalamaciek

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

Comments & Activities

Production build 0.71.5 2024