=== modified file 'modules/block.module'
--- modules/block.module	
+++ modules/block.module	
@@ -445,10 +445,32 @@ function block_box_delete_confirm_submit
 
 
 function block_box_form($edit = array()) {
-  $form['title'] = array('#type' => 'textfield', '#title' => t('Block title'), '#default_value' => $edit['title'], '#maxlength' => 64, '#description' => t('The title of the block as shown to the user.'));
+  $form['title'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Block title'),
+    '#default_value' => $edit['title'],
+    '#maxlength' => 64,
+    '#description' => t('The title of the block as shown to the user.'),
+    '#weight' => -18,
+  );
+  $form['body'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Block body'),
+    '#default_value' => $edit['body'],
+    '#rows' => 15,
+    '#description' => t('The content of the block as shown to the user.'),
+    '#weight' => -17,
+  );
   $form['format'] = filter_form($edit['format']);
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Block body'), '#default_value' => $edit['body'], '#rows' => 15, '#description' => t('The content of the block as shown to the user.'));
-  $form['info'] = array('#type' => 'textfield', '#title' => t('Block description'), '#default_value' => $edit['info'], '#maxlength' => 64, '#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/block'))), '#required' => TRUE);
+  $form['info'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Block description'),
+    '#default_value' => $edit['info'],
+    '#maxlength' => 64,
+    '#description' => t('A brief description of your block. Used on the <a href="%overview">block overview page</a>.', array('%overview' => url('admin/block'))),
+    '#required' => TRUE,
+    '#weight' => -15,
+  );
 
   return $form;
 }
=== modified file 'modules/blog.module'
--- modules/blog.module	
+++ modules/blog.module	
@@ -203,35 +203,33 @@ function blog_validate($node) {
 }
 
 /**
- * Implementation of hook_form().
+ * Implementation of hook_form_alter().
  */
-function blog_form(&$node) {
-  global $nid;
-  $iid = $_GET['iid'];
+function blog_form_alter($form_id, &$form) {
+  if ($form_id == 'blog_node_form') {
+    global $nid;
+    $iid = $_GET['iid'];
+    $form['title'] = $form['node']['title'];
+    $form['body'] = $form['node']['body'];
+    $form['format'] = $form['node']['format'];
+
+    if (empty($form['node']['#value']->body)) {
+      /*
+      ** If the user clicked a "blog it" link, we load the data from the
+      ** database and quote it in the blog:
+      */
 
+      if ($nid && $blog = node_load($nid)) {
+        $form['body']['#value'] = '<em>'. $blog->body .'</em> ['. l($blog->name, "node/$nid") .']';
+      }
 
-  if (empty($node->body)) {
-    /*
-    ** If the user clicked a "blog it" link, we load the data from the
-    ** database and quote it in the blog:
-    */
-
-    if ($nid && $blog = node_load($nid)) {
-      $node->body = '<em>'. $blog->body .'</em> ['. l($blog->name, "node/$nid") .']';
-    }
-
-    if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) {
-      $node->title = $item->title;
-      // Note: $item->description has been validated on aggregation.
-      $node->body = '<a href="'. check_url($item->link) .'">'. check_plain($item->title) .'</a> - <em>'. $item->description .'</em> [<a href="'. check_url($item->flink) .'">'. check_plain($item->ftitle) ."</a>]\n";
+      if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) {
+        $form['title']['#value'] = $item->title;
+        // Note: $item->description has been validated on aggregation.
+        $form['body']['#value'] = '<a href="'. check_url($item->link) .'">'. check_plain($item->title) .'</a> - <em>'. $item->description .'</em> [<a href="'. check_url($item->flink) .'">'. check_plain($item->ftitle) ."</a>]\n";
+      }
     }
-
   }
-
-  $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE);
-  $form = array_merge($form, filter_form($node->format));
-  return $form;
 }
 
 /**
=== modified file 'modules/book.module'
--- modules/book.module	
+++ modules/book.module	
@@ -243,41 +243,40 @@ function book_validate($node) {
 }
 
 /**
- * Implementation of hook_form().
+ * Implementation of hook_form_alter().
  */
-function book_form(&$node) {
-  $form['parent'] = array(
-    '#type' => 'select', '#title' => t('Parent'), '#default_value' => ($node->parent ? $node->parent : arg(4)), '#options' => book_toc($node->nid), '#weight' => -15,
-    '#description' => t('The parent that this page belongs in. Note that pages whose parent is &lt;top-level&gt; are regarded as independent, top-level books.')
-  );
-
-  $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
-  $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
-  );
-  $form = array_merge($form, filter_form($node->format));
-
-  $form['log'] = array(
-    '#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE
-  );
-  $form['log']['message'] = array(
-    '#type' => 'textarea', '#default_value' => $node->log, '#weight' => 18,
-    '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.')
-  );
-
-  if (user_access('administer nodes')) {
-    $form['weight'] = array(
-        '#type' => 'weight', '#title' => t('Weight'),  '#default_value' => $node->weight, '#delta' => 15, '#weight' => -14,
-        '#description' => t('Pages at a given level are ordered first by weight and then by title.')
+function book_form_alter($form_id, &$form) {
+  if ($form_id == 'book_node_form') {
+    $form['title'] = $form['node']['title'];
+    $form['body'] = $form['node']['body'];
+    $form['format'] = $form['node']['format'];
+    $form['log'] = $form['node']['log'];
+
+    $form['parent'] = array(
+      '#type' => 'select',
+      '#title' => t('Parent'),
+      '#default_value' => ($node->parent ? $node->parent : arg(4)),
+      '#options' => book_toc($node->nid),
+      '#weight' => -15,
+      '#description' => t('The parent that this page belongs in. Note that pages whose parent is &lt;top-level&gt; are regarded as independent, top-level books.'),
     );
-  }
-  else {
-    // If a regular user updates a book page, we create a new revision
-    // authored by that user:
-    $form['revision'] = array('#type' => 'hidden', '#value' => 1);
-  }
 
-  return $form;
+    if (user_access('administer nodes')) {
+      $form['weight'] = array(
+          '#type' => 'weight',
+          '#title' => t('Weight'),
+          '#default_value' => $node->weight,
+          '#delta' => 15,
+          '#weight' => -14,
+          '#description' => t('Pages at a given level are ordered first by weight and then by title.'),
+      );
+    }
+    else {
+      // If a regular user updates a book page, we create a new revision
+      // authored by that user:
+      $form['revision'] = array('#type' => 'value', '#value' => 1);
+    }
+  }
 }
 
 /**
=== modified file 'modules/comment.module'
--- modules/comment.module	
+++ modules/comment.module	
@@ -232,8 +232,25 @@ function comment_link($type, $node = 0, 
 }
 
 function comment_form_alter($form_id, &$form) {
-  if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
-    $form['workflow']['comment_'. $form['type']['#value']] = array('#type' => 'radios', '#title' => t('Default comment setting'), '#default_value' => variable_get('comment_'. $form['type']['#value'], 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.'));
+  if (isset($form['type'])) {
+    if ($form['type']['#value'] .'_node_settings' == $form_id) {
+      $form['workflow']['comment_'. $form['type']['#value']] = array('#type' => 'radios', '#title' => t('Default comment setting'), '#default_value' => variable_get('comment_'. $form['type']['#value'], 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.'));
+    }
+    if ($form['type']['#value'] .'_node_form' == $form_id && user_access('administer comments')) {
+      $selected = isset($node->comment) ? $node->comment : variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);
+      $form['user_comments'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('User Comments'),
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
+      );
+      $form['user_comments']['comment'] = array(
+        '#type' => 'radios',
+        '#parents' => array('comment'),
+        '#default_value' => $selected,
+        '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')),
+      );
+    }
   }
 }
 
@@ -246,15 +263,6 @@ function comment_nodeapi(&$node, $op, $a
     case 'fields':
       return array('comment');
 
-    case 'form':
-      if (user_access('administer comments')) {
-        $selected = isset($node->comment) ? $node->comment : variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);
-        $form['user_comments'] = array('#type' => 'fieldset', '#title' => t('User Comments'), '#collapsible' => TRUE, '#collapsed' => TRUE);
-        $form['user_comments']['comment'] = array('#type' => 'radios', '#parents' => array('comment'), '#default_value' => $selected, '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')));
-        return $form;
-      }
-      break;
-
     case 'load':
       return db_fetch_array(db_query("SELECT last_comment_timestamp, last_comment_name, comment_count FROM {node_comment_statistics} WHERE nid = %d", $node->nid));
     case 'validate':
@@ -1148,8 +1156,7 @@ function comment_form($edit, $title = NU
   $form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE
   );
 
-  $form = array_merge($form, filter_form($node->format));
-  $form['format']['#weight'] = 18;
+  $form['format'] = filter_form($node->format, 18);
 
   $form['cid'] = array('#type' => 'value', '#value' => $edit['cid']);
   $form['pid'] = array('#type' => 'value', '#value' => $edit['pid']);
=== modified file 'modules/filter.module'
--- modules/filter.module	
+++ modules/filter.module	
@@ -750,7 +750,7 @@ function check_markup($text, $format = F
  * @return
  *   HTML for the form element.
  */
-function filter_form($value = FILTER_FORMAT_DEFAULT) {
+function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = -16) {
   if ($value == FILTER_FORMAT_DEFAULT) {
     $value = variable_get('filter_default_format', 1);
   }
@@ -759,11 +759,17 @@ function filter_form($value = FILTER_FOR
   $extra = l(t('More information about formatting options'), 'filter/tips');
 
   if (count($formats) > 1) {
-    $form['format'] = array('#type' => 'fieldset', '#title' => t('Input format'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -16);
+    $form = array(
+      '#type' => 'fieldset',
+      '#title' => t('Input format'),
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#weight' => $weight,
+    );
     // Multiple formats available: display radio buttons with tips.
     foreach ($formats as $format) {
-      $form['format'][$format->format] = array(
-        '#type' => 'filter_format',
+      $form[$format->format] = array(
+        '#type' => 'radio',
         '#title' => $format->name,
         '#default_value' => $value,
         '#return_value' => $format->format,
@@ -772,16 +778,19 @@ function filter_form($value = FILTER_FOR
         '#validate' => array('filter_form_validate' => array())
       );
     }
-    return $form;
   }
   else {
     // Only one format available: use a hidden form item and only show tips.
     $format = array_shift($formats);
-    $form['format'][$format->name] = array('#type' => 'value', '#value' => $format->format);
+    $form[$format->name] = array('#type' => 'value', '#value' => $format->format);
     $tips = _filter_tips(variable_get('filter_default_format', 1), false);
-    $form['format']['guidelines'] = array('#type' => 'markup', '#title' => t('Formatting guidelines'), '#value' => theme('filter_tips', $tips, false, $extra));
-    return $form;
+    $form['guidelines'] = array(
+      '#type' => 'markup',
+      '#title' => t('Formatting guidelines'),
+      '#value' => theme('filter_tips', $tips, false, $extra),
+    );
   }
+  return $form;
 }
 
 function filter_form_validate($element) {
=== modified file 'modules/forum.module'
--- modules/forum.module	
+++ modules/forum.module	
@@ -570,30 +570,32 @@ function forum_update($node) {
 }
 
 /**
- * Implementation of hook_form().
+ * Implementation of hook_form_alter().
  */
-function forum_form(&$node) {
-  $form['title'] = array('#type' => 'textfield', '#title' => t('Subject'), '#default_value' => $node->title, '#required' => TRUE);
-
-  if (!$node->nid) {
-    // new topic
-    $node->taxonomy[] = arg(3);
-  }
-  else {
-    $node->taxonomy = array($node->tid);
-  }
+function forum_form_alter($form_id, &$form) {
+  if ($form_id == 'forum_node_form') {
+    $form['title'] = $form['node']['title'];
+    $form['body'] = $form['node']['body'];
+    $form['format'] = $form['node']['format'];
+
+    if (!$node->nid) {
+      // new topic
+      $node->taxonomy[] = arg(3);
+    }
+    else {
+      $node->taxonomy = array($node->tid);
+    }
 
-  if ($node->nid) {
-    // if editing, give option to leave shadows
-    $shadow = (count(taxonomy_node_get_terms($node->nid)) > 1);
-    $form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.'));
+    if ($node->nid) {
+      // if editing, give option to leave shadows
+      $shadow = (count(taxonomy_node_get_terms($node->nid)) > 1);
+      $form['shadow'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Leave shadow copy'),
+        '#default_value' => $shadow,
+        '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.'));
+    }
   }
-
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
-  );
-  $form = array_merge($form, filter_form($node->format));
-
-  return $form;
 }
 
 /**
=== modified file 'modules/menu.module'
--- modules/menu.module	
+++ modules/menu.module	
@@ -165,12 +165,6 @@ function menu_nodeapi(&$node, $op) {
 
   if (user_access('administer menu')) {
     switch ($op) {
-      case 'form':
-        $edit = isset($_POST['edit']) ? $_POST['edit'] : '';
-        $edit['nid'] = isset($node->nid) ? $node->nid : '';
-        return menu_node_form($edit);
-        break;
-
       case 'insert':
       case 'update':
         if ($node->menu['delete']) {
@@ -608,34 +602,37 @@ function menu_parent_options($mid, $pid 
 /**
  * Add menu item fields to the node form.
  */
-function menu_node_form($edit = array()) {
-  $item = array();
-  if ($edit['nid'] > 0) {
-    $item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $edit['nid']));
-    if (is_array($edit['menu'])) {
-      $item = !is_array($item) ? $edit['menu'] : (($_POST['op'] == t('Preview')) ? array_merge($item, $edit['menu']) : array_merge($edit['menu'], $item));
+function menu_form_alter($form_id, &$form) {
+  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
+    $edit = isset($_POST['edit']) ? $_POST['edit'] : '';
+    $edit['nid'] = $form['nid']['#value'];
+
+    $item = array();
+    if ($edit['nid'] > 0) {
+      $item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $edit['nid']));
+      if (is_array($edit['menu'])) {
+        $item = !is_array($item) ? $edit['menu'] : (($_POST['op'] == t('Preview')) ? array_merge($item, $edit['menu']) : array_merge($edit['menu'], $item));
+      }
     }
-  }
 
-  $form['menu'] = array('#type' => 'fieldset', '#title' => t('Menu settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#tree' => TRUE);
+    $form['menu'] = array('#type' => 'fieldset', '#title' => t('Menu settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#tree' => TRUE);
 
-  $form['menu']['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $item['title'], '#description' => t('The name to display for this link.'));
+    $form['menu']['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $item['title'], '#description' => t('The name to display for this link.'));
 
-  // Generate a list of possible parents (not including this item or descendants).
-  $options = menu_parent_options($item['mid']);
-  $form['menu']['pid'] = array('#type' => select, '#title' => t('Parent item'), '#default_value' => $item['pid'], '#options' => $options);
-  $form['menu']['description'] = array('#type' => 'hidden', '#value' => $item['description']);
-  $form['menu']['path'] = array('#type' => 'hidden', '#value' => $item['path']);
-  $form['menu']['weight'] = array('#type' => 'hidden', '#value' => $item['weight'] ? $item['weight'] : 0);
+    // Generate a list of possible parents (not including this item or descendants).
+    $options = menu_parent_options($item['mid']);
+    $form['menu']['pid'] = array('#type' => select, '#title' => t('Parent item'), '#default_value' => $item['pid'], '#options' => $options);
+    $form['menu']['description'] = array('#type' => 'hidden', '#value' => $item['description']);
+    $form['menu']['path'] = array('#type' => 'hidden', '#value' => $item['path']);
+    $form['menu']['weight'] = array('#type' => 'hidden', '#value' => $item['weight'] ? $item['weight'] : 0);
 
-  $form['menu']['mid'] = array('#type' => 'hidden', '#value' => $item['mid'] ? $item['mid'] : 0);
-  $form['menu']['type'] = array('#type' => 'hidden', '#value' => $item['type'] ? $item['type'] : MENU_CUSTOM_ITEM);
+    $form['menu']['mid'] = array('#type' => 'hidden', '#value' => $item['mid'] ? $item['mid'] : 0);
+    $form['menu']['type'] = array('#type' => 'hidden', '#value' => $item['type'] ? $item['type'] : MENU_CUSTOM_ITEM);
 
-  if ($item['mid'] > 0) {
-    $form['menu']['delete'] = array('#type' => 'checkbox', '#title' => t('Check to delete this menu item.'), '#default_value' => $item['delete']);
+    if ($item['mid'] > 0) {
+      $form['menu']['delete'] = array('#type' => 'checkbox', '#title' => t('Check to delete this menu item.'), '#default_value' => $item['delete']);
+    }
   }
-
-  return $form;
 }
 
 /**
=== modified file 'modules/node.module'
--- modules/node.module	
+++ modules/node.module	
@@ -1605,9 +1605,35 @@ function node_form($node) {
   $form['created'] = array('#type' => 'value', '#value' => $node->created);
   $form['changed'] = array('#type' => 'value', '#value' => $node->changed);
   $form['type']    = array('#type' => 'value', '#value' => $node->type);
-
-  // Get the node-specific bits.
-  $form = array_merge($form, node_invoke($node, 'form'));
+  $form['node']    = array('#type' => 'value', '#value' => $node);
+  // preload some basic fields. these are not rendered because type of
+  // $form['node'] is value
+  $form['node']['title'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Title'),
+    '#required' => TRUE,
+    '#default_value' => $node->title,
+    '#weight' => -18,
+  );
+  $form['node']['body'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Body'),
+    '#default_value' => $node->body,
+    '#rows' => 20,
+    '#weight' => -17,
+    '#required' => TRUE,
+  );
+  $form['node']['log'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Log message'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE);
+  $form['node']['log']['message'] = array(
+    '#type' => 'textarea',
+    '#default_value' => $node->log,
+    '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.'),
+  );
+  $form['node']['format'] = filter_form($node->format);
 
   // If this is a new node, fill in the default values.
   $node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
@@ -1651,18 +1677,6 @@ function node_form($node) {
     $form['revision'] = array('#type' => 'value', '#value' => $node->revision);
   }
 
-  $nodeapi = node_invoke_nodeapi($node, 'form');
-  if (is_array($nodeapi)) {
-    foreach ($nodeapi as $key => $element) {
-      $nodeapi[$key]['#weight'] = isset($nodeapi[$key]['#weight']) ? $nodeapi[$key]['#weight'] : -4;
-    }
-    // Append extra node form elements.
-    $form = array_merge($form, $nodeapi);
-  }
-
-  $form['title']['#weight'] = isset($form['title']['#weight']) ? $form['title']['#weight'] : -18;
-  $form['body']['#weight'] = isset($form['body']['#weight']) ? $form['body']['#weight'] : -17;
-
   // Add the buttons.
   $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 19);
 
=== modified file 'modules/page.module'
--- modules/page.module	
+++ modules/page.module	
@@ -86,27 +86,15 @@ function page_validate($node) {
   node_validate_title($node);
 }
 
+
 /**
- * Implementation of hook_form().
+ * Implementation of hook_form_alter().
  */
-function page_form(&$node) {
-
-  $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
-
-  $form['body'] = array(
-    '#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE
-  );
-  $form = array_merge($form, filter_form($node->format));
-
-  $form['log'] = array(
-    '#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE
-  );
-  $form['log']['message'] = array(
-    '#type' => 'textarea', '#default_value' => $node->log,
-    '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.')
-  );
-
-  return $form;
+function page_form_alter($form_id, &$form) {
+  if ($form_id == 'story_node_form') {
+    $form['title'] = $form['node']['title'];
+    $form['body'] = $form['node']['body'];
+    $form['log'] = $form['node']['log'];
+    $form['format'] = $form['node']['format'];
+  }
 }
-
-
=== modified file 'modules/path.module'
--- modules/path.module	
+++ modules/path.module	
@@ -185,14 +185,6 @@ function path_nodeapi(&$node, $op, $arg)
         }
         break;
 
-      case 'form':
-        $form['path'] = array('#type' => 'fieldset', '#title' => t('URL path settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
-        $form['path']['path'] = array('#type' => 'textfield', '#default_value' => $node->path, '#maxlength' => 250, '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('Optionally specify an alternative URL by which this node can be accessed.  For example, type "about" when writing an about page.  Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'));
-        if ($node->path) {
-          $form['path']['pid'] = array('#type' => 'hidden', '#value' => db_result(db_query("SELECT pid FROM {url_alias} WHERE dst = '%s'", $node->path)));
-        }
-        return $form;
-
       case 'load':
         $path = "node/$node->nid";
         $alias = drupal_get_path_alias($path);
@@ -224,6 +216,35 @@ function path_nodeapi(&$node, $op, $arg)
 }
 
 /**
+ * Implementation of hook_form_alter().
+ */
+function path_form_alter($form_id, &$form) {
+  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
+    $form['path'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('URL path settings'),
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+    );
+    $form['path']['path'] = array(
+      '#type' => 'textfield',
+      '#default_value' => $node->path,
+      '#maxlength' => 250,
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#description' => t('Optionally specify an alternative URL by which this node can be accessed.  For example, type "about" when writing an about page.  Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
+    );
+    if ($node->path) {
+      $form['path']['pid'] = array(
+        '#type' => 'value',
+        '#value' => db_result(db_query("SELECT pid FROM {url_alias} WHERE dst = '%s'", $node->path))
+      );
+    }
+  }
+}
+
+
+/**
  * Implementation of hook_perm().
  */
 function path_perm() {
=== modified file 'modules/poll.module'
--- modules/poll.module	
+++ modules/poll.module	
@@ -125,45 +125,46 @@ function poll_validate($node) {
 }
 
 /**
- * Implementation of hook_form().
+ * Implementation of hook_form_alter().
  */
-function poll_form(&$node) {
-  $admin = user_access('administer nodes');
+function poll_form_alter($form_id, &$form) {
+  if ($form_id == 'poll_node_form') {
+    $admin = user_access('administer nodes');
+    $node = $form['node']['#value'];
 
-  $form['title'] = array('#type' => 'textfield', '#title' => t('Question'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -1);
+    $form['title'] = $form['node']['title'];
 
-  if (!isset($node->choices)) {
-    $node->choices = max(2, count($node->choice) ? count($node->choice) : 5);
-  }
+    if (!isset($node->choices)) {
+      $node->choices = max(2, count($node->choice) ? count($node->choice) : 5);
+    }
 
-  // User ticked 'need more choices'.
-  if ($_POST['edit']['morechoices']) {
-    $node->choices *= 2;
-  }
+    // User ticked 'need more choices'.
+    if ($_POST['edit']['morechoices']) {
+      $node->choices *= 2;
+    }
 
-  // Poll choices
-  $opts = drupal_map_assoc(range(2, $node->choices * 2 + 5));
-  $form['choice'] = array('#type' => 'fieldset', '#title' => t('Choices'), '#prefix' => '<div class="poll-form">', '#suffix' => '</div>', '#tree' => TRUE);
-  for ($a = 0; $a < $node->choices; $a++) {
-    $form['choice'][$a]['chtext'] = array('#type' => 'textfield', '#title' => t('Choice %n', array('%n' => ($a + 1))), '#default_value' => $node->choice[$a]['chtext']);
-    if ($admin) {
-      $form['choice'][$a]['chvotes'] = array('#type' => 'textfield', '#title' => t('Votes for choice %n', array('%n' => ($a + 1))), '#default_value' => (int)$node->choice[$a]['chvotes'], '#size' => 5, '#maxlength' => 7);
+    // Poll choices
+    $opts = drupal_map_assoc(range(2, $node->choices * 2 + 5));
+    $form['choice'] = array('#type' => 'fieldset', '#title' => t('Choices'), '#prefix' => '<div class="poll-form">', '#suffix' => '</div>', '#tree' => TRUE);
+    for ($a = 0; $a < $node->choices; $a++) {
+      $form['choice'][$a]['chtext'] = array('#type' => 'textfield', '#title' => t('Choice %n', array('%n' => ($a + 1))), '#default_value' => $node->choice[$a]['chtext']);
+      if ($admin) {
+        $form['choice'][$a]['chvotes'] = array('#type' => 'textfield', '#title' => t('Votes for choice %n', array('%n' => ($a + 1))), '#default_value' => (int)$node->choice[$a]['chvotes'], '#size' => 5, '#maxlength' => 7);
+      }
     }
-  }
-  $form['choices'] = array('#type' => 'hidden', '#value' => $node->choices);
-  $form['morechoices'] = array('#type' => 'checkbox', '#title' => t('Need more choices'), '#default_value' => 0, '#description' => t("If the amount of boxes above isn't enough, check this box and click the Preview button below to add some more."));
+    $form['choices'] = array('#type' => 'hidden', '#value' => $node->choices);
+    $form['morechoices'] = array('#type' => 'checkbox', '#title' => t('Need more choices'), '#default_value' => 0, '#description' => t("If the amount of boxes above isn't enough, check this box and click the Preview button below to add some more."));
 
-  // Poll attributes
-  $_duration = array(0 => t('Unlimited')) + drupal_map_assoc(array(86400, 172800, 345600, 604800, 1209600, 2419200, 4838400, 9676800, 31536000), "format_interval");
-  $_active = array(0 => t('Closed'), 1 => t('Active'));
+    // Poll attributes
+    $_duration = array(0 => t('Unlimited')) + drupal_map_assoc(array(86400, 172800, 345600, 604800, 1209600, 2419200, 4838400, 9676800, 31536000), "format_interval");
+    $_active = array(0 => t('Closed'), 1 => t('Active'));
 
-  if ($admin) {
-    $form['settings'] = array('#type' => 'fieldset', '#title' => t('Settings'), '#suffix' => '</div>');
-    $form['settings']['active'] = array('#type' => 'radios', '#title' => t('Poll status'), '#default_value' => isset($node->active) ? $node->active : 1, '#options' => $_active, '#description' => t('When a poll is closed, visitors can no longer vote for it.'));
+    if ($admin) {
+      $form['settings'] = array('#type' => 'fieldset', '#title' => t('Settings'), '#suffix' => '</div>');
+      $form['settings']['active'] = array('#type' => 'radios', '#title' => t('Poll status'), '#default_value' => isset($node->active) ? $node->active : 1, '#options' => $_active, '#description' => t('When a poll is closed, visitors can no longer vote for it.'));
+    }
+    $form['settings']['runtime'] = array('#type' => 'select', '#title' => t('Poll duration'), '#default_value' => $node->runtime ? $node->runtime : 0, '#options' => $_duration, '#description' => t('After this period, the poll will be closed automatically.'));
   }
-  $form['settings']['runtime'] = array('#type' => 'select', '#title' => t('Poll duration'), '#default_value' => $node->runtime ? $node->runtime : 0, '#options' => $_duration, '#description' => t('After this period, the poll will be closed automatically.'));
-
-  return $form;
 }
 
 function poll_insert($node) {
=== modified file 'modules/story.module'
--- modules/story.module	
+++ modules/story.module	
@@ -82,20 +82,13 @@ function story_validate($node) {
 }
 
 /**
- * Implementation of hook_form().
+ * Implementation of hook_form_alter().
  */
-function story_form(&$node) {
-
-  $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title);
-
-  $form['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE);
-  $form = array_merge($form, filter_form($node->format));
-
-  $form['log'] = array('#type' => 'fieldset', '#title' => t('Log message'), '#collapsible' => TRUE, '#collapsed' => TRUE);
-  $form['log']['message'] = array('#type' => 'textarea', '#default_value' => $node->log, '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.')
-  );
-
-  return $form;
+function story_form_alter($form_id, &$form) {
+  if ($form_id == 'story_node_form') {
+    $form['title'] = $form['node']['title'];
+    $form['body'] = $form['node']['body'];
+    $form['log'] = $form['node']['log'];
+    $form['format'] = $form['node']['format'];
+  }
 }
-
-
=== modified file 'modules/taxonomy.module'
--- modules/taxonomy.module	
+++ modules/taxonomy.module	
@@ -500,51 +500,52 @@ function taxonomy_get_vocabularies($type
 /**
  * Generate a form for selecting terms to associate with a node.
  */
-function taxonomy_node_form($node) {
-  if (!array_key_exists('taxonomy', $node)) {
-    if ($node->nid) {
-      $terms = taxonomy_node_get_terms($node->nid);
+function taxonomy_form_alter($form_id, &$form) {
+  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
+    $node = $form['node']['#value'];
+
+    if (!array_key_exists('taxonomy', $node)) {
+      if ($node->nid) {
+        $terms = taxonomy_node_get_terms($node->nid);
+      }
+      else {
+        $terms = array();
+      }
     }
     else {
-      $terms = array();
+      $terms = $node->taxonomy;
     }
-  }
-  else {
-    $terms = $node->taxonomy;
-  }
 
-  $c = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'v', 'vid'), $node->type);
-  while ($vocabulary = db_fetch_object($c)) {
-    if ($vocabulary->tags) {
-      $typed_terms = array();
-      foreach ($terms as $term) {
-        if ($term->vid == $vocabulary->vid) {
-
-          // Commas and quotes in terms are special cases, so encode 'em.
-          if (preg_match('/,/', $term->name) || preg_match('/"/', $term->name)) {
-            $term->name = '"'.preg_replace('/"/', '""', $term->name).'"';
-          }
+    $c = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'v', 'vid'), $node->type);
+
+    while ($vocabulary = db_fetch_object($c)) {
+      if ($vocabulary->tags) {
+        $typed_terms = array();
+        foreach ($terms as $term) {
+          if ($term->vid == $vocabulary->vid) {
 
-          $typed_terms[] = $term->name;
+            // Commas and quotes in terms are special cases, so encode 'em.
+            if (preg_match('/,/', $term->name) || preg_match('/"/', $term->name)) {
+              $term->name = '"'.preg_replace('/"/', '""', $term->name).'"';
+            }
+
+            $typed_terms[] = $term->name;
+          }
         }
-      }
-      $typed_string = implode(', ', $typed_terms) . (array_key_exists('tags', $terms) ? $terms['tags'][$vocabulary->vid] : NULL);
+        $typed_string = implode(', ', $typed_terms) . (array_key_exists('tags', $terms) ? $terms['tags'][$vocabulary->vid] : NULL);
 
-      $form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield', '#default_value' => $typed_string, '#maxlength' => 100, '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid, '#required' => $vocabulary->required, '#title' => $vocabulary->name, '#description' => t('A comma-separated list of terms describing this content (Example: funny, bungie jumping, "Company, Inc.").'));
+        $form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield', '#default_value' => $typed_string, '#maxlength' => 100, '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid, '#required' => $vocabulary->required, '#title' => $vocabulary->name, '#description' => t('A comma-separated list of terms describing this content (Example: funny, bungie jumping, "Company, Inc.").'));
+      }
+      else {
+        $ntterms = array_key_exists('taxonomy', $node) ? $terms : array_keys($terms);
+        $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, $ntterms, $help, 'taxonomy');
+      }
     }
-    else {
-      $ntterms = array_key_exists('taxonomy', $node) ? $terms : array_keys($terms);
-      $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, $ntterms, $help, 'taxonomy');
+    if (isset($form['taxonomy'])) {
+      $form['taxonomy']['#tree'] = TRUE;
+      $form['taxonomy']['#weight'] = -15;
     }
   }
-  if ($form) {
-    $form['taxonomy']['#tree'] = TRUE;
-    $form['taxonomy']['#weight'] = -15;
-    return $form;
-  }
-  else {
-    return array();
-  }
 }
 
 /**
@@ -1056,9 +1057,6 @@ function taxonomy_nodeapi($node, $op, $a
     case 'rss item':
       return taxonomy_rss_item($node);
       break;
-    case 'form':
-      return taxonomy_node_form($node);
-      break;
   }
 }
 
=== modified file 'modules/upload.module'
--- modules/upload.module	
+++ modules/upload.module	
@@ -145,11 +145,28 @@ function upload_file_download($file) {
 }
 
 function upload_form_alter($form_id, &$form) {
-  if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
-    $form['workflow']['upload_'. $form['type']['#value']] = array(
-      '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $form['type']['#value'], 1),
-      '#options' => array(t('Disabled'), t('Enabled')),
-    );
+  if (isset($form['type'])) {
+    if ($form['type']['#value'] .'_node_settings' == $form_id) {
+      $form['workflow']['upload_'. $form['type']['#value']] = array(
+        '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $form['type']['#value'], 1),
+        '#options' => array(t('Disabled'), t('Enabled')),
+      );
+    }
+    if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("upload_$node->type", 1) == 1 && user_access('upload files')) {
+      drupal_add_js('misc/progress.js');
+      drupal_add_js('misc/upload.js');
+      $form['attachments'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('File attachments'),
+        '#collapsible' => TRUE,
+        '#collapsed' => empty($node->files),
+        '#description' => t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.'),
+        '#prefix' => '<div class="attachments">',
+        '#suffix' => '</div>',
+      );
+      $form['attachments'] += _upload_form($node);
+      $form['#attributes'] = array('enctype' => 'multipart/form-data');
+    }
   }
 }
 
@@ -234,13 +251,6 @@ function upload_nodeapi(&$node, $op, $ar
       }
       break;
 
-    case 'form':
-      if (variable_get("upload_$node->type", 1) == 1 && user_access('upload files')) {
-        $output = upload_form($node);
-        $output['#attributes'] = array('enctype' => 'multipart/form-data');
-      }
-      break;
-
     case 'load':
       if (variable_get("upload_$node->type", 1) == 1) {
         $output['files'] = upload_load($node);
@@ -401,20 +411,6 @@ function upload_delete($node) {
   db_query("DELETE FROM {files} WHERE nid = %d", $node->nid);
 }
 
-function upload_form($node) {
-  drupal_add_js('misc/progress.js');
-  drupal_add_js('misc/upload.js');
-
-  $form['attachments'] = array(
-    '#type' => 'fieldset', '#title' => t('File attachments'), '#collapsible' => TRUE, '#collapsed' => empty($node->files),
-    '#description' => t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.'),
-    '#prefix' => '<div class="attachments">', '#suffix' => '</div>'
-  );
-  $form['attachments'] += _upload_form($node);
-
-  return $form;
-}
-
 function _upload_form($node) {
   $header = array(t('Delete'), t('List'), t('Description'), t('Size'));
   $rows = array();
