Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / content_moderation / src / Entity / ContentModerationState.php
index e54fbbe2a8203e5d835815eea94997dfcaa987bc..abb92eb8411ebedef8196d35f17e676dc1133cc3 100644 (file)
@@ -31,6 +31,7 @@ use Drupal\user\UserInterface;
  *   data_table = "content_moderation_state_field_data",
  *   revision_data_table = "content_moderation_state_field_revision",
  *   translatable = TRUE,
+ *   internal = TRUE,
  *   entity_keys = {
  *     "id" = "id",
  *     "revision" = "revision_id",
@@ -221,4 +222,16 @@ class ContentModerationState extends ContentEntityBase implements ContentModerat
     return parent::save();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  protected function getFieldsToSkipFromTranslationChangesCheck() {
+    $field_names = parent::getFieldsToSkipFromTranslationChangesCheck();
+    // We need to skip the parent entity revision ID, since that will always
+    // change on every save, otherwise every translation would be marked as
+    // affected regardless of actual changes.
+    $field_names[] = 'content_entity_revision_id';
+    return $field_names;
+  }
+
 }