diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php index baef459..91ec62d 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php @@ -346,12 +346,6 @@ public function save(EntityInterface $entity) { // Ensure we are dealing with the actual entity. $entity = $entity->getNGEntity(); - // There are some cases that pre-set ->original for performance. Make sure - // original is not a BC decorator. - if ($entity->original instanceof \Drupal\Core\Entity\EntityBCDecorator) { - $entity->original = $entity->original->getNGEntity(); - } - // Sync the changes made in the fields array to the internal values array. $entity->updateOriginalValues(); diff --git a/core/modules/node/lib/Drupal/node/NodeStorageController.php b/core/modules/node/lib/Drupal/node/NodeStorageController.php index a03ef4e..db3ba75 100644 --- a/core/modules/node/lib/Drupal/node/NodeStorageController.php +++ b/core/modules/node/lib/Drupal/node/NodeStorageController.php @@ -153,7 +153,7 @@ protected function preSaveRevision(\stdClass $record, EntityInterface $entity) { // need to make sure $entity->log is reset whenever it is empty. // Therefore, this code allows us to avoid clobbering an existing log // entry with an empty one. - $record->log = $entity->original->log->value; + $record->log = $entity->original->log; } } diff --git a/core/modules/user/lib/Drupal/user/UserStorageController.php b/core/modules/user/lib/Drupal/user/UserStorageController.php index 8b882ee..6ff15c4 100644 --- a/core/modules/user/lib/Drupal/user/UserStorageController.php +++ b/core/modules/user/lib/Drupal/user/UserStorageController.php @@ -116,6 +116,11 @@ public function save(EntityInterface $entity) { $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {users}')->fetchField()); $entity->enforceIsNew(); } + // There are some cases that pre-set ->original for performance. Make sure + // original is not a BC decorator. + if ($entity->original instanceof EntityBCDecorator) { + $entity->original = $entity->original->getNGEntity(); + } parent::save($entity); }