From 3860f5ac4468f24eb44698a7e30d5c3e4012843f Mon Sep 17 00:00:00 2001 From: Herb Date: Thu, 7 Mar 2024 19:10:55 -0500 Subject: [PATCH] Issue #6103: Hide revision by default if revisions disabled, and clarify description. By @herbdool, @kswan, @klonos, @izmeez, and @yorkshire-pudding. --- core/modules/node/node.types.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/modules/node/node.types.inc b/core/modules/node/node.types.inc index 5ac78dd4ce7..07922dc8ef7 100644 --- a/core/modules/node/node.types.inc +++ b/core/modules/node/node.types.inc @@ -418,7 +418,7 @@ function node_type_form($form, &$form_state, $type = NULL) { ); $form['revision']['revision']['revision_enabled'] = array( '#type' => 'checkbox', - '#title' => t('Show option to create new revisions'), + '#title' => t('Enable option to create revisions'), '#default_value' => $type->settings['revision_enabled'], '#parents' => array('revision_enabled'), '#description' => t('Revisions allow content editors to view changes over time and revert changes if needed.'), @@ -426,8 +426,17 @@ function node_type_form($form, &$form_state, $type = NULL) { $form['revision']['revision']['revision_default'] = array( '#type' => 'checkbox', '#title' => t('Create new revision by default'), + '#description' => t('If enabled, revisions to content will be created by default. People with the "Administer content" permission will see an option to create a revision.'), '#default_value' => $type->settings['revision_default'], '#parents' => array('revision_default'), + '#states' => array( + 'visible' => array( + 'input[name="revision_enabled"]' => array('checked' => TRUE), + ), + 'enabled' => array( + 'input[name="revision_enabled"]' => array('checked' => TRUE), + ), + ), ); // Menu settings.