diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index 4a730d1..e74e571 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -221,19 +221,12 @@ protected function invokeFieldMethod($method, ContentEntityInterface $entity) { */ protected function hasFieldValueChanged(FieldDefinitionInterface $field_definition, ContentEntityInterface $entity, ContentEntityInterface $original) { $field_name = $field_definition->getName(); - if ($field_definition->isTranslatable()) { - $langcodes = array_keys($entity->getTranslationLanguages()); + $langcodes = array_keys($entity->getTranslationLanguages()); + if ($langcodes !== array_keys($original->getTranslationLanguages())) { + // If the list of langcodes has changed, we need to save. + return TRUE; } - else { - $langcodes = [$entity->getUntranslated()->language()->getId()]; - } - foreach ($langcodes as $langcode) { - // If the original entity doesn't have this translation, we need to save. - if (!$original->hasTranslation($langcode)) { - return TRUE; - } - $items = $entity->getTranslation($langcode)->get($field_name)->filterEmptyItems(); $originalItems = $original->getTranslation($langcode)->get($field_name)->filterEmptyItems(); // If the field items are not equal, we need to save.