diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-26 02:43:48 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-26 02:43:48 +0000 |
commit | 8b1e5d05052c85e6ac36a83d79052dd79c024319 (patch) | |
tree | 09129dacad60abcf681199c99e4eb11626f7b957 | |
parent | b5bf8a8f476fe4214478fec9250e651164b0e76f (diff) | |
download | brdo-8b1e5d05052c85e6ac36a83d79052dd79c024319.tar.gz brdo-8b1e5d05052c85e6ac36a83d79052dd79c024319.tar.bz2 |
#97231 by pwolanin. Keep the node type in a property and use it consistently.
-rw-r--r-- | modules/comment/comment.module | 2 | ||||
-rw-r--r-- | modules/node/content_types.inc | 2 | ||||
-rw-r--r-- | modules/upload/upload.module | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 395a2040e..4b9010563 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -267,7 +267,7 @@ function comment_form_alter($form_id, &$form) { $form['workflow']['comment'] = array( '#type' => 'radios', '#title' => t('Default comment setting'), - '#default_value' => variable_get('comment_'. $form['identity']['type']['#default_value'], COMMENT_NODE_READ_WRITE), + '#default_value' => variable_get('comment_'. $form['#node_type']->type, COMMENT_NODE_READ_WRITE), '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), '#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'), ); diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index 389234617..9ce85e4fa 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -67,6 +67,8 @@ function node_type_form($type = NULL) { $type->locked = FALSE; } + $form['#node_type'] = $type; // Make the type object availabe to implementations of hook_form_alter. + $form['identity'] = array( '#type' => 'fieldset', '#title' => t('Identification'), diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 9dc86e52e..835ba6d63 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -348,7 +348,7 @@ function upload_form_alter($form_id, &$form) { $form['workflow']['upload'] = array( '#type' => 'radios', '#title' => t('Attachments'), - '#default_value' => variable_get('upload_'. $form['identity']['type']['#default_value'], 1), + '#default_value' => variable_get('upload_'. $form['#node_type']->type, 1), '#options' => array(t('Disabled'), t('Enabled')), ); } |