diff --git a/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php b/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php index e793c338fa..203022dfbe 100644 --- a/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php +++ b/core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php @@ -34,6 +34,8 @@ public function onPresave(ContentEntityInterface $entity, $default_revision, $pu $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); } diff --git a/core/modules/content_moderation/src/EntityOperations.php b/core/modules/content_moderation/src/EntityOperations.php index 6cb2791807..38ec7cdcc5 100644 --- a/core/modules/content_moderation/src/EntityOperations.php +++ b/core/modules/content_moderation/src/EntityOperations.php @@ -241,7 +241,7 @@ public function entityView(array &$build, EntityInterface $entity, EntityViewDis // - The revision is not translation affected. // - There are more than one translation languages. // - The entity has forward revisions. - if ($this->moderationInfo->isForwardRevisionAllowed($entity)) { + if (!$this->moderationInfo->isForwardRevisionAllowed($entity)) { return; } diff --git a/core/modules/content_moderation/src/EntityTypeInfo.php b/core/modules/content_moderation/src/EntityTypeInfo.php index 1757711361..7782421758 100644 --- a/core/modules/content_moderation/src/EntityTypeInfo.php +++ b/core/modules/content_moderation/src/EntityTypeInfo.php @@ -300,7 +300,7 @@ public function formAlter(array &$form, FormStateInterface $form_state, $form_id ->getHandler($entity->getEntityTypeId(), 'moderation') ->enforceRevisionsEntityFormAlter($form, $form_state, $form_id); - if ($this->moderationInfo->isForwardRevisionAllowed($entity)) { + if (!$this->moderationInfo->isForwardRevisionAllowed($entity)) { $latest_revision = $this->moderationInfo->getLatestRevision($entity->getEntityTypeId(), $entity->id()); if ($entity->bundle()) { $bundle_type_id = $entity->getEntityType()->getBundleEntityType(); diff --git a/core/modules/content_moderation/src/ModerationInformationInterface.php b/core/modules/content_moderation/src/ModerationInformationInterface.php index 92e338daa6..bf6b1ac0ce 100644 --- a/core/modules/content_moderation/src/ModerationInformationInterface.php +++ b/core/modules/content_moderation/src/ModerationInformationInterface.php @@ -103,6 +103,8 @@ public function getAffectedRevisionTranslation(ContentEntityInterface $entity); /** * Determines if forward revisions are allowed. * + * @internal + * * @param \Drupal\Core\Entity\ContentEntityInterface $entity * The content entity. *