Change record status: 
Project: 
Introduced in branch: 
10.2.x
Introduced in version: 
10.2.0
Description: 

Content Entities supporting revisions (eg. node) are marked as syncing during migrations and as a result, new revisions are not created during migrations.

If your migrations need to create revisions, implement hook_entity_presave() or hook_ENTITY_TYPE_presave() to force revision creation, such as the following example.

/**
 * Implements hook_entity_presave().
 */
function mymodule_entity_presave(\Drupal\Core\Entity\EntityInterface $entity) {
  if (($entity->getEntityTypeId() == 'node') && $entity->isSyncing() && !$entity->isNew()) {
    $entity->setNewRevision(TRUE);
    $entity->isDefaultRevision(TRUE);
  }
}
Impacts: 
Site builders, administrators, editors
Module developers

Comments

ressa’s picture

The date is somehow set to "16 June 2024".

ressa’s picture

Please update the date, otherwise this will stay at the top the next three months :)

ressa’s picture