diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index 127c188..ef936cc 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -305,7 +305,9 @@ protected function doPostSave(EntityInterface $entity, $update) { // The revision is stored, it should no longer be marked as new now. if ($this->entityType->isRevisionable()) { - $entity->resetOriginalRevisionId(); + if ($entity instanceof OriginalRevisionIdInterface) { + $entity->resetOriginalRevisionId(); + } $entity->setNewRevision(FALSE); } } diff --git a/core/lib/Drupal/Core/Entity/OriginalRevisionIdInterface.php b/core/lib/Drupal/Core/Entity/OriginalRevisionIdInterface.php index 4cacc4e..111f642 100644 --- a/core/lib/Drupal/Core/Entity/OriginalRevisionIdInterface.php +++ b/core/lib/Drupal/Core/Entity/OriginalRevisionIdInterface.php @@ -7,12 +7,7 @@ /** * Gets the original revision identifier of the entity. * - * After calling ::setNewRevision, the revision identifier will be unset to - * enforce the creation of a new revision identifier on save and - * ::getRevisionId will not be able to return the revision identifier, for - * which the entity has been loaded, but ::getOriginalRevisionId will. - * - * @return + * @return int * The original revision identifier of the entity, or NULL if the entity * does not have a revision identifier. */ @@ -21,7 +16,7 @@ public function getOriginalRevisionId(); /** * Resets the original revision identifier after the entity got a new one. * - * After the entity has been saved, the storage should call this function to + * After the entity has been saved, the storage must call this function to * set the original revision identifier to the new one, the entity received * after it has been saved. */