Index: modules/blog/blog.install
===================================================================
RCS file: modules/blog/blog.install
diff -N modules/blog/blog.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/blog/blog.install	8 Apr 2010 07:18:09 -0000
@@ -0,0 +1,17 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Install, update and uninstall functions for the blog module.
+ */
+
+/**
+ * Implements hook_install().
+ */
+function blog_install() {
+  // Ensure the blog node type is available.
+  node_types_rebuild();
+  $types = node_type_get_types();
+  node_add_body_field($types['blog']);
+}
Index: modules/book/book.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.install,v
retrieving revision 1.34
diff -u -p -r1.34 book.install
--- modules/book/book.install	4 Dec 2009 16:49:45 -0000	1.34
+++ modules/book/book.install	8 Apr 2010 07:18:09 -0000
@@ -37,6 +37,7 @@ function _book_install_type_create() {
 
   $book_node_type = node_type_set_defaults($book_node_type);
   node_type_save($book_node_type);
+  node_add_body_field($book_node_type);
   // Default to not promoted.
   variable_set('node_options_book', array('status'));
   // Use this default type for adding content to books.
Index: modules/field_ui/field_ui.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.test,v
retrieving revision 1.15
diff -u -p -r1.15 field_ui.test
--- modules/field_ui/field_ui.test	7 Apr 2010 17:30:43 -0000	1.15
+++ modules/field_ui/field_ui.test	8 Apr 2010 07:18:09 -0000
@@ -26,15 +26,15 @@ class FieldUITestCase extends DrupalWebT
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
-    $type_name =  strtolower($this->randomName(8)) . '_' .'test';
-    $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name));
+    $this->type_name = drupal_strtolower($this->randomName(8)) . '_' .'test';
+    $type = $this->drupalCreateContentType(array('name' => $this->type_name, 'type' => $this->type_name));
     $this->type = $type->type;
     // Store a valid URL name, with hyphens instead of underscores.
     $this->hyphen_type = str_replace('_', '-', $this->type);
 
     // Create random field name.
     $this->field_label = $this->randomName(8);
-    $this->field_name = 'field_' . strtolower($this->randomName(8));
+    $this->field_name = 'field_' . drupal_strtolower($this->randomName(8));
   }
 
   /**
Index: modules/forum/forum.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v
retrieving revision 1.43
diff -u -p -r1.43 forum.install
--- modules/forum/forum.install	27 Mar 2010 05:52:50 -0000	1.43
+++ modules/forum/forum.install	8 Apr 2010 07:18:09 -0000
@@ -66,6 +66,10 @@ function forum_enable() {
 
     variable_set('forum_nav_vocabulary', $vocabulary->vid);
   }
+  // Ensure the forum node type is available.
+  node_types_rebuild();
+  $types = node_type_get_types();
+  node_add_body_field($types['forum']);
 }
 
 /**
Index: modules/node/content_types.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v
retrieving revision 1.110
diff -u -p -r1.110 content_types.inc
--- modules/node/content_types.inc	13 Jan 2010 23:36:50 -0000	1.110
+++ modules/node/content_types.inc	8 Apr 2010 07:18:09 -0000
@@ -149,12 +149,6 @@ function node_type_form($form, &$form_st
     $form['submission']['title_label']['#description'] = t('This content type does not have a title field.');
     $form['submission']['title_label']['#required'] = FALSE;
   }
-  $form['submission']['body_label'] = array(
-    '#title' => t('Body field label'),
-    '#type' => 'textfield',
-    '#default_value' => isset($type->body_label) ? $type->body_label : '',
-    '#description' => t('To remove the body field, remove text and leave blank.'),
-  );
   $form['submission']['node_preview'] = array(
     '#type' => 'radios',
     '#title' => t('Preview before submitting'),
@@ -311,12 +305,9 @@ function node_type_form_submit($form, &$
   $type->description = $form_state['values']['description'];
   $type->help = $form_state['values']['help'];
   $type->title_label = $form_state['values']['title_label'];
-  $type->body_label = $form_state['values']['body_label'];
-
   // title_label is required in core; has_title will always be true, unless a
   // module alters the title field.
   $type->has_title = ($type->title_label != '');
-  $type->has_body = ($type->body_label != '');
 
   $type->base = !empty($form_state['values']['base']) ? $form_state['values']['base'] : 'node_content';
   $type->custom = $form_state['values']['custom'];
@@ -361,6 +352,7 @@ function node_type_form_submit($form, &$
 
   node_types_rebuild();
   menu_rebuild();
+  node_add_body_field($type);
   $t_args = array('%name' => $type->name);
 
   if ($status == SAVED_UPDATED) {
Index: modules/node/content_types.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.js,v
retrieving revision 1.8
diff -u -p -r1.8 content_types.js
--- modules/node/content_types.js	2 Dec 2009 15:09:16 -0000	1.8
+++ modules/node/content_types.js	8 Apr 2010 07:18:09 -0000
@@ -5,10 +5,7 @@ Drupal.behaviors.contentTypes = {
   attach: function (context) {
     // Provide the vertical tab summaries.
     $('fieldset#edit-submission', context).setSummary(function(context) {
-      var vals = [];
-      vals.push(Drupal.checkPlain($('#edit-title-label', context).val()) || Drupal.t('Requires a title'));
-      vals.push(Drupal.checkPlain($('#edit-body-label', context).val()) || Drupal.t('No body'));
-      return vals.join(', ');
+      return Drupal.checkPlain($('#edit-title-label', context).val()) || Drupal.t('Requires a title');
     });
     $('fieldset#edit-workflow', context).setSummary(function(context) {
       var vals = [];
Index: modules/node/node.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.api.php,v
retrieving revision 1.66
diff -u -p -r1.66 node.api.php
--- modules/node/node.api.php	26 Mar 2010 17:14:45 -0000	1.66
+++ modules/node/node.api.php	8 Apr 2010 07:18:10 -0000
@@ -771,10 +771,6 @@ function hook_node_view_alter(&$build) {
  *      field. Optional (defaults to TRUE).
  *   - "title_label": the label for the title field of this content type.
  *      Optional (defaults to 'Title').
- *   - "has_body": boolean indicating whether or not this node type has a body
- *      field. Optional (defaults to TRUE).
- *   - "body_label": the label for the body field of this content type. Optional
- *      (defaults to 'Body').
  *   - "locked": boolean indicating whether the administrator can change the
  *      machine name of this type. FALSE = changeable (not locked),
  *      TRUE = unchangeable (locked). Optional (defaults to TRUE).
@@ -986,17 +982,6 @@ function hook_prepare($node) {
 function hook_form($node, $form_state) {
   $type = node_type_get_type($node);
 
-  $form['title'] = array(
-    '#type' => 'textfield',
-    '#title' => check_plain($type->title_label),
-    '#required' => TRUE,
-  );
-  $form['body'] = array(
-    '#type' => 'textarea',
-    '#title' => check_plain($type->body_label),
-    '#rows' => 20,
-    '#required' => TRUE,
-  );
   $form['field1'] = array(
     '#type' => 'textfield',
     '#title' => t('Custom field'),
Index: modules/node/node.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.install,v
retrieving revision 1.46
diff -u -p -r1.46 node.install
--- modules/node/node.install	28 Mar 2010 11:16:29 -0000	1.46
+++ modules/node/node.install	8 Apr 2010 07:18:10 -0000
@@ -306,21 +306,6 @@ function node_schema() {
         'default' => '',
         'translatable' => TRUE,
       ),
-      'has_body' => array(
-        'description' => 'Boolean indicating whether this type has the body field attached.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'size' => 'tiny',
-      ),
-      'body_label' => array(
-        'description' => 'The label displayed for the body field on the edit form.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-        'translatable' => TRUE,
-      ),
       'custom' => array(
         'description' => 'A boolean indicating whether this type is defined by a module (FALSE) or by a user via Add content type (TRUE).',
         'type' => 'int',
@@ -496,30 +481,48 @@ function node_update_7005() {
 /**
  * Convert body and teaser from node properties to fields, and migrate status/comment/promote and sticky columns to the {node_revision} table.
  */
-function node_update_7006(&$context) {
-  $context['#finished'] = 0;
+function node_update_7006(&$sandbox) {
+  $sandbox['#finished'] = 0;
 
   // Get node type info for every invocation.
   drupal_static_reset('_node_types_build');
   $node_types = node_type_get_types();
 
-  if (!isset($context['total'])) {
+  if (!isset($sandbox['total'])) {
     // Initial invocation.
 
-    // Re-save node types to create body field instances.
-    foreach ($node_types as $type => $info) {
-      if ($info->has_body) {
-        node_type_save($info);
+    // Get default title and body fields.
+    $default_instances = node_type_default_field_instances();
+ 
+    // Get node type info, specifically the fields that this update will deprecate.
+    $result = db_select('node_type', 'node_type')
+      ->fields('node_type')
+      ->execute();
+ 
+    // Add title and body field instances for existing node types.
+    foreach ($result as $node_type) {
+      if ($node_type->has_body) {
+        $instance = field_info_instance('node', 'body', $node_type->type);
+        if (empty($instance)) {
+          $instance = $default_instances['body'];
+          $instance['bundle'] = $node_type->type;
+          $instance['label'] = $node_type->body_label;
+          field_create_instance($instance);
+        }
       }
+
+      $sandbox['node_types_info'][$node_type->type] = array(
+        'has_body' => $node_type->has_body,
+      );
     }
 
     // Initialize state for future calls.
-    $context['last'] = 0;
-    $context['count'] = 0;
+    $sandbox['last'] = 0;
+    $sandbox['count'] = 0;
 
     $query = db_select('node', 'n');
     $query->join('node_revision', 'nr', 'n.vid = nr.vid');
-    $context['total'] = $query->countQuery()->execute()->fetchField();
+    $sandbox['total'] = $query->countQuery()->execute()->fetchField();
   }
   else {
     // Subsequent invocations.
@@ -529,7 +532,7 @@ function node_update_7006(&$context) {
     $body_field_id = $body_field['id'];
 
     $found = FALSE;
-    if ($context['total']) {
+    if ($sandbox['total']) {
       // Operate on every revision of every node (whee!), in batches.
       $batch_size = 200;
       $query = db_select('node_revision', 'nr');
@@ -537,7 +540,7 @@ function node_update_7006(&$context) {
       $query
         ->fields('nr', array('nid', 'vid', 'body', 'teaser', 'format'))
         ->fields('n', array('type', 'status', 'comment', 'promote', 'sticky'))
-        ->condition('nr.vid', $context['last'], '>')
+        ->condition('nr.vid', $sandbox['last'], '>')
         ->orderBy('nr.vid', 'ASC')
         ->range(0, $batch_size);
       $revisions = $query->execute();
@@ -552,7 +555,7 @@ function node_update_7006(&$context) {
       foreach ($revisions as $revision) {
         $found = TRUE;
 
-        if ($node_types[$revision->type]->has_body) {
+        if ($sandbox['node_types_info'][$revision->type]['has_body']) {
           $node = (object) array(
             'nid' => $revision->nid,
             'vid' => $revision->vid,
@@ -588,11 +591,11 @@ function node_update_7006(&$context) {
           ->condition('vid', $revision->vid)
           ->execute();
 
-        $context['last'] = $revision->vid;
-        $context['count'] += 1;
+        $sandbox['last'] = $revision->vid;
+        $sandbox['count'] += 1;
       }
 
-      $context['#finished'] = min(0.99, $context['count'] / $context['total']);
+      $context['#finished'] = min(0.99, $sandbox['count'] / $sandbox['total']);
     }
 
     if (!$found) {
@@ -603,9 +606,12 @@ function node_update_7006(&$context) {
       db_drop_field('node_revision', 'teaser');
       db_drop_field('node_revision', 'format');
 
+      // Remove node_type properties related to the former 'body'.
+      db_drop_field('node_type', 'has_body');
+      db_drop_field('node_type', 'body_label');
+
       // We're done.
-      $context['#finished'] = 1;
-      return t("!number node body and teaser properties migrated to the 'body' field.", array('!number' => $context['total']));
+      $sandbox['#finished'] = 1;
     }
   }
 }
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1257
diff -u -p -r1.1257 node.module
--- modules/node/node.module	7 Apr 2010 14:36:16 -0000	1.1257
+++ modules/node/node.module	8 Apr 2010 07:18:11 -0000
@@ -511,8 +511,6 @@ function node_type_save($info) {
     'base' => (string) $type->base,
     'has_title' => (int) $type->has_title,
     'title_label' => (string) $type->title_label,
-    'has_body' => (int) $type->has_body,
-    'body_label' => (string) $type->body_label,
     'description' => (string) $type->description,
     'help' => (string) $type->help,
     'custom' => (int) $type->custom,
@@ -529,7 +527,6 @@ function node_type_save($info) {
     if (!empty($type->old_type) && $type->old_type != $type->type) {
       field_attach_rename_bundle('node', $type->old_type, $type->type);
     }
-    node_configure_fields($type);
     module_invoke_all('node_type_update', $type);
     $status = SAVED_UPDATED;
   }
@@ -540,7 +537,7 @@ function node_type_save($info) {
       ->execute();
 
     field_attach_create_bundle('node', $type->type);
-    node_configure_fields($type);
+
     module_invoke_all('node_type_insert', $type);
     $status = SAVED_NEW;
   }
@@ -552,60 +549,43 @@ function node_type_save($info) {
 }
 
 /**
- * Manage the field(s) for a node type.
- *
- * Currently, the node module manages a single Field API field,
- * 'body'.  If $type->has_body is true, this function ensures the
- * 'body' field exists and creates an instance of it for the bundle
- * $type->type (e.g. 'page', 'story', ...).  If $type->has_body is
- * false, this function removes the instance (if it exists) for the
- * 'body' field on $type->type.
+ * Add default fields and instances to a node type.
  */
-function node_configure_fields($type) {
+function node_add_body_field($type) {
    // Add or remove the body field, as needed.
   $field = field_info_field('body');
   $instance = field_info_instance('node', 'body', $type->type);
-  if ($type->has_body) {
-    if (empty($field)) {
-      $field = array(
-        'field_name' => 'body',
-        'type' => 'text_with_summary',
-        'entity_types' => array('node'),
-        'translatable' => TRUE,
-      );
-      $field = field_create_field($field);
-    }
-    if (empty($instance)) {
-      $instance = array(
-        'field_name' => 'body',
-        'entity_type' => 'node',
-        'bundle' => $type->type,
-        'label' => $type->body_label,
-        'widget_type' => 'text_textarea_with_summary',
-        'settings' => array('display_summary' => TRUE),
-
-        // Define default formatters for the teaser and full view.
-        'display' => array(
-          'full' => array(
-            'label' => 'hidden',
-            'type' => 'text_default',
-          ),
-          'teaser' => array(
-            'label' => 'hidden',
-            'type' => 'text_summary_or_trimmed',
-          ),
+  if (empty($field)) {
+    $field = array(
+      'field_name' => 'body',
+      'type' => 'text_with_summary',
+      'entity_types' => array('node'),
+      'translatable' => TRUE,
+    );
+    $field = field_create_field($field);
+  }
+  if (empty($instance)) {
+    $instance = array(
+      'field_name' => 'body',
+      'entity_type' => 'node',
+      'bundle' => $type->type,
+      'label' => 'Body',
+      'widget_type' => 'text_textarea_with_summary',
+      'settings' => array('display_summary' => TRUE),
+
+      // Define default formatters for the teaser and full view.
+      'display' => array(
+        'full' => array(
+          'label' => 'hidden',
+          'type' => 'text_default',
         ),
-      );
-      field_create_instance($instance);
-    }
-    else {
-      $instance['label'] = $type->body_label;
-      $instance['settings']['display_summary'] = TRUE;
-      field_update_instance($instance);
-    }
-  }
-  elseif (!empty($instance)) {
-    field_delete_instance($instance);
+        'teaser' => array(
+          'label' => 'hidden',
+          'type' => 'text_summary_or_trimmed',
+        ),
+      ),
+    );
+    field_create_instance($instance);
   }
 }
 
@@ -752,14 +732,13 @@ function node_type_set_defaults($info = 
     $type->base = '';
     $type->description = '';
     $type->help = '';
-    $type->has_title = 1;
-    $type->has_body = 1;
-    $type->title_label = t('Title');
-    $type->body_label = t('Body');
     $type->custom = 0;
     $type->modified = 0;
     $type->locked = 1;
     $type->is_new = 1;
+
+    $type->has_title = 1;
+    $type->title_label = 'Title';
   }
 
   $new_type = clone $type;
@@ -767,19 +746,70 @@ function node_type_set_defaults($info = 
   foreach ($info as $key => $data) {
     $new_type->$key = $data;
   }
-  // If the type has no title or body, set an empty label.
+  // If the type has no title, set an empty label.
   if (!$new_type->has_title) {
     $new_type->title_label = '';
   }
-  if (!$new_type->has_body) {
-    $new_type->body_label = '';
-  }
   $new_type->orig_type = isset($info['type']) ? $info['type'] : '';
 
   return $new_type;
 }
 
 /**
+ * Ensure that default node fields exist, and return instance arrays.
+ *
+ * If no $type is provided, this will ensure that the default fields (title and
+ * body) exist, and return instance arrays with 'bundle' set to NULL.
+ *
+ * @param $type
+ *   A node type object.
+ * @return
+ *   An array of the two default field instances for nodes: 'title' and 'body'.
+ */
+function node_type_default_field_instances($type = NULL) {
+  if ($type === NULL) {
+    $type->type = NULL;
+  }
+
+  // Make sure that the default fields exist.
+  $field = field_info_field('body');
+  if (empty($field)) {
+    $field = array(
+      'field_name' => 'body',
+      'type' => 'text_with_summary',
+      'translatable' => TRUE,
+    );
+    $field = field_create_field($field );
+  }
+
+  // Default field instances.
+  $default_instances = array(
+    'body' => array(
+      'field_name' => 'body',
+      'object_type' => 'node',
+      'bundle' => $type->type,
+      'label' => 'Body',
+      'widget_type' => 'text_textarea_with_summary',
+      'settings' => array('display_summary' => TRUE),
+
+      // Define default formatters for the teaser and full view.
+      'display' => array(
+        'full' => array(
+          'label' => 'hidden',
+          'type' => 'text_default',
+        ),
+        'teaser' => array(
+          'label' => 'hidden',
+          'type' => 'text_summary_or_trimmed',
+        ),
+      ),
+    ),
+  );
+
+  return $default_instances;
+}
+
+/**
  * Implements hook_rdf_mapping().
  */
 function node_rdf_mapping() {
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.78
diff -u -p -r1.78 node.test
--- modules/node/node.test	31 Mar 2010 20:05:06 -0000	1.78
+++ modules/node/node.test	8 Apr 2010 07:18:12 -0000
@@ -1020,39 +1020,33 @@ class NodeTypeTestCase extends DrupalWeb
     $this->assertRaw('Title', t('Title field was found.'));
     $this->assertRaw('Body', t('Body field was found.'));
 
-    // Rename the title field and remove the body field.
+    // Rename the title field.
     $edit = array(
       'title_label' => 'Foo',
-      'body_label' => '',
     );
     $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
+    // Refresh the field information for the rest of the test.
     field_info_cache_clear();
 
-    $this->assertFalse(field_info_instance('node', 'body', 'page'), t('Body field was removed.'));
     $this->drupalGet('node/add/page');
     $this->assertRaw('Foo', t('New title label was displayed.'));
     $this->assertNoRaw('Title', t('Old title label was not displayed.'));
-    $this->assertNoRaw('Full text', t('Body field was not found.'));
 
-    // Add the body field again and change the name, machine name and description.
+    // Change the name, machine name and description.
     $edit = array(
       'name' => 'Bar',
       'type' => 'bar',
       'description' => 'Lorem ipsum.',
-      'body_label' => 'Baz',
     );
     $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
-    field_info_cache_clear();
 
-    $instance = field_info_instance('node', 'body', 'bar');
-    $this->assertEqual($instance['label'], 'Baz', t('Body field was added.'));
     $this->drupalGet('node/add');
     $this->assertRaw('Bar', t('New name was displayed.'));
     $this->assertRaw('Lorem ipsum', t('New description was displayed.'));
     $this->clickLink('Bar');
     $this->assertEqual(url('node/add/bar', array('absolute' => TRUE)), $this->getUrl(), t('New machine name was used in URL.'));
     $this->assertRaw('Foo', t('Title field was found.'));
-    $this->assertRaw('Baz', t('Body field was found.'));
+    $this->assertRaw('Body', t('Body field was found.'));
   }
 }
 
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.208
diff -u -p -r1.208 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	7 Apr 2010 17:30:43 -0000	1.208
+++ modules/simpletest/drupal_web_test_case.php	8 Apr 2010 07:18:13 -0000
@@ -837,6 +837,7 @@ class DrupalWebTestCase extends DrupalTe
     $saved_type = node_type_save($type);
     node_types_rebuild();
     menu_rebuild();
+    node_add_body_field($type);
 
     $this->assertEqual($saved_type, SAVED_NEW, t('Created content type %type.', array('%type' => $type->type)));
 
Index: profiles/standard/standard.install
===================================================================
RCS file: /cvs/drupal/drupal/profiles/standard/standard.install,v
retrieving revision 1.11
diff -u -p -r1.11 standard.install
--- profiles/standard/standard.install	27 Mar 2010 05:52:50 -0000	1.11
+++ profiles/standard/standard.install	8 Apr 2010 07:18:13 -0000
@@ -227,6 +227,7 @@ function standard_install() {
   foreach ($types as $type) {
     $type = node_type_set_defaults($type);
     node_type_save($type);
+    node_add_body_field($type);
   }
 
   // Insert default pre-defined RDF mapping into the database.
