diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index 79b09b7..bbfda73 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -1277,10 +1277,21 @@ public function hasTranslationChanges() { // possible or be meaningless. /** @var \Drupal\Core\Entity\ContentEntityBase $translation */ $translation = $original->getTranslation($this->activeLangcode); + + // A list of known revision metadata fields which should be skipped from + // the comparision. + $revision_metadata_fields = [ + $this->getEntityType()->getKey('revision'), + 'revision_translation_affected', + 'revision_uid', 'revision_user', + 'revision_timestamp', 'revision_created', + 'revision_log', 'revision_log_message' + ]; + foreach ($this->getFieldDefinitions() as $field_name => $definition) { // @todo Avoid special-casing the following fields. See // https://www.drupal.org/node/2329253. - if ($field_name == 'revision_translation_affected' || $field_name == 'revision_id') { + if (in_array($field_name, $revision_metadata_fields)) { continue; } if (!$definition->isComputed()) { diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index c8ef06e..115a91f 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -157,7 +157,11 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setDescription(t('The parents of this term.')) ->setSetting('target_type', 'taxonomy_term') ->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED) - ->setCustomStorage(TRUE); + ->setCustomStorage(TRUE) + // Marking as computed as the parent field has its own storage and in + // order for ContentEntityInterface::hasTranslationChanges to skip it + // from the comparision. + ->setComputed(TRUE); $fields['changed'] = BaseFieldDefinition::create('changed') ->setLabel(t('Changed'))