diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index a01be29..5536859 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -52,6 +52,10 @@ * This property will be set and used during the saving process. * * @var \Drupal\Core\Entity\EntityInterface + * + * @deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\EntityInterface::getOriginalDefaultRevision() + * instead. */ public $original; @@ -639,4 +643,11 @@ public function getConfigTarget() { return $this->uuid(); } + /** + * {@inheritdoc} + */ + public function getOriginalDefaultRevision() { + return $this->original; + } + } diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php index 8890fb7..47d8afb 100644 --- a/core/lib/Drupal/Core/Entity/EntityInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityInterface.php @@ -502,4 +502,13 @@ public function getConfigDependencyName(); */ public function getConfigTarget(); + /** + * Returns the unchanged entity for the default revision. + * + * This is only available while an entity is being saved. + * + * @return static + */ + public function getOriginalDefaultRevision(); + } diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php index b6841a8..6c676dc 100644 --- a/core/modules/views_ui/src/ViewUI.php +++ b/core/modules/views_ui/src/ViewUI.php @@ -1348,4 +1348,11 @@ public function addCacheTags(array $cache_tags) { return $this->storage->addCacheTags($cache_tags); } + /** + * {@inheritdoc} + */ + public function getOriginalDefaultRevision() { + return $this->storage->getOriginalDefaultRevision(); + } + }