From f1c248053761eca7f142f09fdd270195f46b0ac9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 24 Mar 2010 07:46:06 +0000 Subject: - Patch #685784 by alexj, sun: 'Create new revision' setting for content type isn't used in node edit form. --- modules/node/node.pages.inc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'modules/node') diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 43ce0b4ac..d4f4f6544 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -163,14 +163,18 @@ function node_form($form, &$form_state, $node) { '#type' => 'checkbox', '#title' => t('Create new revision'), '#default_value' => $node->revision, - '#states' => array( - // Check the revision log checkbox when the log textarea is filled in. + '#access' => user_access('administer nodes'), + ); + // 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 (!$node->revision) { + $form['revision_information']['revision']['#states'] = array( 'checked' => array( 'textarea[name="log"]' => array('empty' => FALSE), ), - ), - '#access' => user_access('administer nodes'), - ); + ); + } $form['revision_information']['log'] = array( '#type' => 'textarea', '#title' => t('Revision log message'), -- cgit v1.2.3