diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php index 6a50c71..228825f 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -961,9 +961,6 @@ protected function doSave($id, EntityInterface $entity) { if ($this->revisionDataTable) { $this->saveToSharedTables($entity, $this->revisionDataTable); } - if ($this->revisionTable) { - $entity->setNewRevision(FALSE); - } } else { // Ensure the entity is still seen as new after assigning it an id, @@ -991,11 +988,6 @@ protected function doSave($id, EntityInterface $entity) { if ($this->revisionDataTable) { $this->saveToSharedTables($entity, $this->revisionDataTable); } - - $entity->enforceIsNew(FALSE); - if ($this->revisionTable) { - $entity->setNewRevision(FALSE); - } } $this->invokeFieldMethod($is_new ? 'insert' : 'update', $entity); $this->saveToDedicatedTables($entity, !$is_new); @@ -1003,6 +995,10 @@ protected function doSave($id, EntityInterface $entity) { if (!$is_new && $this->dataTable) { $this->invokeTranslationHooks($entity); } + $entity->enforceIsNew(FALSE); + if ($this->revisionTable) { + $entity->setNewRevision(FALSE); + } return $return; }