diff core/modules/content_moderation/src/Entity/ContentModerationState.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children af1871eacc83
line wrap: on
line diff
--- a/core/modules/content_moderation/src/Entity/ContentModerationState.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/modules/content_moderation/src/Entity/ContentModerationState.php	Mon Apr 23 09:46:53 2018 +0100
@@ -31,6 +31,7 @@
  *   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 @@
     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;
+  }
+
 }