Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.468 diff -u -p -r1.468 book.module --- modules/book/book.module 17 Sep 2008 20:37:31 -0000 1.468 +++ modules/book/book.module 27 Sep 2008 04:00:33 -0000 @@ -295,7 +295,7 @@ function book_get_books() { */ function book_form_alter(&$form, $form_state, $form_id) { - if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) { + if (!empty($form['#node_edit_form'])) { // Add elements to the node form. $node = $form['#node']; Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.650 diff -u -p -r1.650 comment.module --- modules/comment/comment.module 17 Sep 2008 20:37:31 -0000 1.650 +++ modules/comment/comment.module 27 Sep 2008 04:00:33 -0000 @@ -532,24 +532,22 @@ function comment_form_alter(&$form, $for '#options' => array(t('Display on separate page'), t('Display below post or comments')), ); } - elseif (isset($form['type']) && isset($form['#node'])) { - if ($form['type']['#value'] . '_node_form' == $form_id) { - $node = $form['#node']; - $form['comment_settings'] = array( - '#type' => 'fieldset', - '#access' => user_access('administer comments'), - '#title' => t('Comment settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#weight' => 30, - ); - $form['comment_settings']['comment'] = array( - '#type' => 'radios', - '#parents' => array('comment'), - '#default_value' => $node->comment, - '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), - ); - } + elseif (!empty($form['#node_edit_form'])) { + $node = $form['#node']; + $form['comment_settings'] = array( + '#type' => 'fieldset', + '#access' => user_access('administer comments'), + '#title' => t('Comment settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#weight' => 30, + ); + $form['comment_settings']['comment'] = array( + '#type' => 'radios', + '#parents' => array('comment'), + '#default_value' => $node->comment, + '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), + ); } } Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.168 diff -u -p -r1.168 menu.module --- modules/menu/menu.module 15 Sep 2008 20:48:08 -0000 1.168 +++ modules/menu/menu.module 27 Sep 2008 04:01:12 -0000 @@ -350,7 +350,7 @@ function _menu_parent_depth_limit($item) * Implementation of hook_form_alter(). Adds menu item fields to the node form. */ function menu_form_alter(&$form, $form_state, $form_id) { - if (isset($form['#node']) && $form['#node']->type . '_node_form' == $form_id) { + if (!empty($form['#node_edit_form'])) { // Note - doing this to make sure the delete checkbox stays in the form. $form['#cache'] = TRUE; Index: modules/node/node.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v retrieving revision 1.37 diff -u -p -r1.37 node.pages.inc --- modules/node/node.pages.inc 19 Sep 2008 07:39:00 -0000 1.37 +++ modules/node/node.pages.inc 27 Sep 2008 04:00:33 -0000 @@ -117,8 +117,9 @@ function node_form(&$form_state, $node) $node->build_mode = NODE_BUILD_PREVIEW; } - // Set the id of the top-level form tag + // Set the id and identify this as a node edit form. $form['#id'] = 'node-form'; + $form['#node_edit_form'] = TRUE; // Basic node information. // These elements are just values so they are not even sent to the client. Index: modules/path/path.module =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.module,v retrieving revision 1.145 diff -u -p -r1.145 path.module --- modules/path/path.module 17 Sep 2008 20:37:32 -0000 1.145 +++ modules/path/path.module 27 Sep 2008 04:00:33 -0000 @@ -172,7 +172,7 @@ function path_nodeapi(&$node, $op, $arg) * Implementation of hook_form_alter(). */ function path_form_alter(&$form, $form_state, $form_id) { - if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) { + if (!empty($form['#node_edit_form'])) { $path = isset($form['#node']->path) ? $form['#node']->path : NULL; $form['path'] = array( '#type' => 'fieldset', Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.429 diff -u -p -r1.429 taxonomy.module --- modules/taxonomy/taxonomy.module 24 Sep 2008 18:42:00 -0000 1.429 +++ modules/taxonomy/taxonomy.module 27 Sep 2008 04:00:33 -0000 @@ -503,7 +503,7 @@ function taxonomy_get_vocabularies($type * and provide scalable alternatives. */ function taxonomy_form_alter(&$form, $form_state, $form_id) { - if (isset($form['type']) && isset($form['#node']) && (!variable_get('taxonomy_override_selector', FALSE)) && $form['type']['#value'] . '_node_form' == $form_id) { + if (!variable_get('taxonomy_override_selector', FALSE) && !empty($form['#node_edit_form'])) { $node = $form['#node']; if (!isset($node->taxonomy)) { Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.206 diff -u -p -r1.206 upload.module --- modules/upload/upload.module 15 Sep 2008 09:28:50 -0000 1.206 +++ modules/upload/upload.module 27 Sep 2008 04:00:33 -0000 @@ -217,9 +217,9 @@ function upload_form_alter(&$form, $form ); } - if (isset($form['type']) && isset($form['#node'])) { + if (!empty($form['#node_edit_form'])) { $node = $form['#node']; - if ($form['type']['#value'] . '_node_form' == $form_id && variable_get("upload_$node->type", TRUE)) { + if (variable_get("upload_$node->type", TRUE)) { // Attachments fieldset $form['attachments'] = array( '#type' => 'fieldset',