core/lib/Drupal/Core/Entity/ContentEntityBase.php | 9 +-------- core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php | 3 +-- core/lib/Drupal/Core/Entity/FieldableEntityInterface.php | 7 ------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index 9c5eb9f..2766e0f 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -262,6 +262,7 @@ protected function getLanguages() { */ public function postCreate(EntityStorageInterface $storage) { $this->newRevision = TRUE; + $this->changedFields = []; } /** @@ -587,14 +588,6 @@ public function getChangedFields() { /** * {@inheritdoc} */ - public function resetChangedFieldList() { - $this->changedFields = []; - return $this; - } - - /** - * {@inheritdoc} - */ public function getTranslatableFields($include_computed = TRUE) { $fields = []; foreach ($this->getFieldDefinitions() as $name => $definition) { diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index fba244a..6449470 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -86,7 +86,6 @@ protected function doCreate(array $values) { } $entity = new $this->entityClass([], $this->entityTypeId, $bundle); $this->initFieldValues($entity, $values); - $entity->resetChangedFieldList(); return $entity; } @@ -136,7 +135,7 @@ public function createTranslation(ContentEntityInterface $entity, $langcode, arr $values[$this->getEntityType()->getKey('default_langcode')] = FALSE; $this->initFieldValues($translation, $values, $field_names); $this->invokeHook('translation_create', $translation); - $translation->resetChangedFieldList(); + $translation->postCreate($this); return $translation; } diff --git a/core/lib/Drupal/Core/Entity/FieldableEntityInterface.php b/core/lib/Drupal/Core/Entity/FieldableEntityInterface.php index 90f7cff..0ee2c7a 100644 --- a/core/lib/Drupal/Core/Entity/FieldableEntityInterface.php +++ b/core/lib/Drupal/Core/Entity/FieldableEntityInterface.php @@ -244,11 +244,4 @@ public function setValidationRequired($required); */ public function getChangedFields(); - /** - * Resets the list an array of changed field names. - * - * @return $this - */ - public function resetChangedFieldList(); - }