summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-24 07:46:06 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-24 07:46:06 +0000
commitf1c248053761eca7f142f09fdd270195f46b0ac9 (patch)
tree3ce42eff7461a0b21cab09ec39c356105c717664 /modules/node
parentcc35d98859328ab23dc8186a6a3bf88c0dd3c3a6 (diff)
downloadbrdo-f1c248053761eca7f142f09fdd270195f46b0ac9.tar.gz
brdo-f1c248053761eca7f142f09fdd270195f46b0ac9.tar.bz2
- Patch #685784 by alexj, sun: 'Create new revision' setting for content type isn't used in node edit form.
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.pages.inc14
1 files changed, 9 insertions, 5 deletions
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'),