diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 5b29e87..6740541 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -130,12 +130,9 @@ public function getOriginalId() { * {@inheritdoc} */ public function setOriginalId($id) { - // Do not call the parent method since that would mark this entity as no - // longer new. Unlike content entities new configuration entities have an - // ID. - // @see https://www.drupal.org/node/2405165 $this->originalId = $id; - return $this; + + return parent::setOriginalId($id); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php index ca17e64..4636c2a 100644 --- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php +++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php @@ -472,6 +472,7 @@ public function __sleep() { * {@inheritdoc} */ public function __wakeup() { + $is_new = $this->isNew(); // Determine what were the properties from toArray() that were saved in // __sleep(). $keys = $this->_serializedKeys; @@ -480,6 +481,7 @@ public function __wakeup() { // Run those values through the __construct(), as if they came from a // regular entity load. $this->__construct($values, $this->entityTypeId); + $this->enforceIsNew($is_new); } }