diff -u b/core/lib/Drupal/Core/Entity/Form/RevisionableContentEntityForm.php b/core/lib/Drupal/Core/Entity/Form/RevisionableContentEntityForm.php --- b/core/lib/Drupal/Core/Entity/Form/RevisionableContentEntityForm.php +++ b/core/lib/Drupal/Core/Entity/Form/RevisionableContentEntityForm.php @@ -142,21 +142,17 @@ '#group' => 'revision_information', ]; - // Check the revision log checkbox when the log textarea is filled in. - // This must not happen if "Create new revision" is enabled by default, - // since the state would auto-disable the checkbox otherwise. - if (!$new_revision_default) { - $form['revision']['#states'] = [ - 'checked' => [ - 'textarea[name="revision_log[0][value]"]' => ['empty' => FALSE], + if (isset($form['revision_log'])) { + $form['revision_log'] += [ + '#group' => 'revision_information', + '#states' => [ + 'visible' => [ + ':input[name="revision"]' => ['checked' => TRUE], + ], ], ]; } - if (isset($form['revision_log'])) { - $form['revision_log']['#group'] = 'revision_information'; - } - return $form; } diff -u b/core/modules/block_content/src/BlockContentTranslationHandler.php b/core/modules/block_content/src/BlockContentTranslationHandler.php --- b/core/modules/block_content/src/BlockContentTranslationHandler.php +++ b/core/modules/block_content/src/BlockContentTranslationHandler.php @@ -5,7 +5,6 @@ use Drupal\block_content\Entity\BlockContentType; use Drupal\Core\Entity\EntityInterface; use Drupal\content_translation\ContentTranslationHandler; -use Drupal\Core\Form\FormStateInterface; /** * Defines the translation handler for custom blocks. diff -u b/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php --- b/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -65,7 +65,7 @@ } if ($preview = $store->get($uuid)) { - /** @var $preview \Drupal\Core\Form\FormStateInterface */ + /** @var \Drupal\Core\Form\FormStateInterface $preview */ foreach ($preview->getValues() as $name => $value) { $form_state->setValue($name, $value); @@ -102,15 +102,4 @@ $form['revision']['#access'] = $current_user->hasPermission('administer nodes') && !$node->isNew(); - // Clear revision states, because it will conflicts with revision_log state. - $form['revision']['#states']['checked'] = []; - - $form['revision_log'] += [ - '#states' => [ - 'visible' => [ - ':input[name="revision"]' => ['checked' => TRUE], - ], - ], - ]; - // Node author information for administrators. $form['author'] = array(