summaryrefslogtreecommitdiffstats
path: root/core/modules/content_moderation/src/Entity
diff options
context:
space:
mode:
authoreffulgentsia2018-02-06 03:39:45 (GMT)
committereffulgentsia2018-02-06 03:39:45 (GMT)
commita26167382e52351795ac285f3ee8643a3bbc60d0 (patch)
tree8a635db389f1311ca91a34a4b945dae500a56c28 /core/modules/content_moderation/src/Entity
parentdd993b38f6807a99d61cded55ccca58f94cae8b0 (diff)
Issue #2860097 by plach, timmillwood, Sam152, Wim Leers, hchonov, catch, amateescu, matsbla: Ensure that content translations can be moderated independently
Diffstat (limited to 'core/modules/content_moderation/src/Entity')
-rw-r--r--core/modules/content_moderation/src/Entity/ContentModerationState.php12
-rw-r--r--core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php5
2 files changed, 12 insertions, 5 deletions
diff --git a/core/modules/content_moderation/src/Entity/ContentModerationState.php b/core/modules/content_moderation/src/Entity/ContentModerationState.php
index e54fbbe..b56f0d8 100644
--- a/core/modules/content_moderation/src/Entity/ContentModerationState.php
+++ b/core/modules/content_moderation/src/Entity/ContentModerationState.php
@@ -221,4 +221,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;
+ }
+
}
diff --git a/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php b/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php
index f2c6917..c44ab09 100644
--- a/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php
+++ b/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php
@@ -35,11 +35,6 @@ class ModerationHandler implements ModerationHandlerInterface, EntityHandlerInte
// This is probably not necessary if configuration is setup correctly.
$entity->setNewRevision(TRUE);
$entity->isDefaultRevision($default_revision);
- if ($entity->hasField('revision_translation_affected')) {
- // @todo remove this when revision and translation issues have been
- // resolved. https://www.drupal.org/node/2860097
- $entity->set('revision_translation_affected', TRUE);
- }
// Update publishing status if it can be updated and if it needs updating.
if (($entity instanceof EntityPublishedInterface) && $entity->isPublished() !== $published_state) {