summaryrefslogtreecommitdiffstats
path: root/core/modules/node/src
diff options
context:
space:
mode:
authorGabor Hojtsy2018-01-20 16:56:17 +0100
committerGabor Hojtsy2018-01-20 16:59:18 +0100
commitd229279900d1d7d759f0e029bdc28715a20ede2b (patch)
tree3988a04e63d83c74052ed68de62527f86b508109 /core/modules/node/src
parent9aaf79dfa568057aa207437258832174a88bdc54 (diff)
Issue #2878556 by plach, matsbla, vijaycs85, Gábor Hojtsy, catch, gabesullice, effulgentsia, hchonov, hass, amateescu, xjm: Ensure that changes to untranslatable fields affect only one translation in pending revisionsHEAD8.5.x
(cherry picked from commit 27c3b40e39a6d231866830b28d509632afee0e66)
Diffstat (limited to 'core/modules/node/src')
-rw-r--r--core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php b/core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php
index 0c68d8b..eb07b7a 100644
--- a/core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php
+++ b/core/modules/node/src/Form/NodeRevisionRevertTranslationForm.php
@@ -88,10 +88,15 @@ class NodeRevisionRevertTranslationForm extends NodeRevisionRevertForm {
$this->langcode = $langcode;
$form = parent::buildForm($form, $form_state, $node_revision);
+ // Unless untranslatable fields are configured to affect only the default
+ // translation, we need to ask the user whether they should be included in
+ // the revert process.
+ $default_translation_affected = $this->revision->isDefaultTranslationAffectedOnly();
$form['revert_untranslated_fields'] = [
'#type' => 'checkbox',
'#title' => $this->t('Revert content shared among translations'),
- '#default_value' => FALSE,
+ '#default_value' => $default_translation_affected && $this->revision->getTranslation($this->langcode)->isDefaultTranslation(),
+ '#access' => !$default_translation_affected,
];
return $form;