### Eclipse Workspace Patch 1.0
#P drupal_test_7
Index: modules/node/node.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.tpl.php,v
retrieving revision 1.13
diff -u -r1.13 node.tpl.php
--- modules/node/node.tpl.php	18 Jun 2009 21:19:02 -0000	1.13
+++ modules/node/node.tpl.php	20 Jun 2009 17:51:07 -0000
@@ -7,9 +7,9 @@
  *
  * Available variables:
  * - $title: the (sanitized) title of the node.
- * - $content: An array of node items. Use render($content) to print them all, or 
- *   print a subset such as render($content['field_example']). Use 
- *   hide($content['field_example]) to temporarily suppress the printing of a 
+ * - $content: An array of node items. Use render($content) to print them all, or
+ *   print a subset such as render($content['field_example']). Use
+ *   hide($content['field_example]) to temporarily suppress the printing of a
  *   given element.
  * - $comments: the themed list of comments (if any).
  * - $picture: The authors picture of the node output from
@@ -36,7 +36,6 @@
  *   - node-promoted: Nodes promoted to the front page.
  *   - node-sticky: Nodes ordered above other non-sticky nodes in teaser listings.
  *   - node-unpublished: Unpublished nodes visible only to administrators.
- * TODO D7 : document $FIELD_NAME_rendered variables.
  *
  * Other variables:
  * - $node: Full node object. Contains data that may not be safe.
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1071
diff -u -r1.1071 node.module
--- modules/node/node.module	18 Jun 2009 21:19:02 -0000	1.1071
+++ modules/node/node.module	20 Jun 2009 17:51:07 -0000
@@ -507,15 +507,13 @@
           'full' => array(
             'label' => 'hidden',
             'type' => 'text_default',
-            'exclude' => 0,
-            ),
+          ),
           'teaser' => array(
             'label' => 'hidden',
             'type' => 'text_summary_or_trimmed',
-            'exclude' => 0,
-            ),
           ),
-        );
+        ),
+      );
       field_create_instance($instance);
     }
     else {
@@ -1281,10 +1279,6 @@
   // Clean up name so there are no underscores.
   $variables['template_files'][] = 'node-' . str_replace('_', '-', $node->type);
   $variables['template_files'][] = 'node-' . $node->nid;
-
-  // Add $FIELD_NAME_rendered variables for fields.
-  drupal_function_exists('field_attach_preprocess');
-  $variables += field_attach_preprocess('node', $node);
 }
 
 /**
Index: modules/field/field.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.test,v
retrieving revision 1.27
diff -u -r1.27 field.test
--- modules/field/field.test	16 Jun 2009 08:40:18 -0000	1.27
+++ modules/field/field.test	20 Jun 2009 17:51:06 -0000
@@ -491,18 +491,11 @@
     field_update_instance($this->instance);
     $entity->content = field_attach_view($entity_type, $entity);
     $output = drupal_render($entity->content);
-    $variables = field_attach_preprocess($entity_type, $entity);
-    $variable = $this->instance['field_name'] . '_rendered';
-    $this->assertTrue(isset($variables[$variable]), "Variable $variable is available in templates.");
     $this->content = $output;
     $this->assertRaw($this->instance['label'], "Label is displayed.");
-    $this->content = $variables[$variable];
-    $this->assertRaw($this->instance['label'], "Label is displayed (template variable).");
     foreach ($values as $delta => $value) {
       $this->content = $output;
       $this->assertRaw("$formatter_setting|{$value['value']}", "Value $delta is displayed, formatter settings are applied.");
-      $this->content = $variables[$variable];
-      $this->assertRaw("$formatter_setting|{$value['value']}", "Value $delta is displayed, formatter settings are applied (template variable).");
     }
 
     // Label hidden.
@@ -510,11 +503,8 @@
     field_update_instance($this->instance);
     $entity->content = field_attach_view($entity_type, $entity);
     $output = drupal_render($entity->content);
-    $variables = field_attach_preprocess($entity_type, $entity);
     $this->content = $output;
     $this->assertNoRaw($this->instance['label'], "Hidden label: label is not displayed.");
-    $this->content = $variables[$variable];
-    $this->assertNoRaw($this->instance['label'], "Hidden label: label is not displayed (template variable).");
 
     // Field hidden.
     $this->instance['display'] = array(
@@ -526,8 +516,6 @@
     field_update_instance($this->instance);
     $entity->content = field_attach_view($entity_type, $entity);
     $output = drupal_render($entity->content);
-    $variables = field_attach_preprocess($entity_type, $entity);
-    $this->assertTrue(isset($variables[$variable]), "Hidden field: variable $variable is available in templates.");
     $this->content = $output;
     $this->assertNoRaw($this->instance['label'], "Hidden field: label is not displayed.");
     foreach ($values as $delta => $value) {
@@ -548,18 +536,14 @@
     field_update_instance($this->instance);
     $entity->content = field_attach_view($entity_type, $entity);
     $output = drupal_render($entity->content);
-    $variables = field_attach_preprocess($entity_type, $entity);
     $display = $formatter_setting;
     foreach ($values as $delta => $value) {
       $display .= "|$delta:{$value['value']}";
     }
     $this->content = $output;
     $this->assertRaw($display, "Multiple formatter: all values are displayed, formatter settings are applied.");
-    $this->content = $variables[$variable];
-    $this->assertRaw($display, "Multiple formatter: all values are displayed, formatter settings are applied (template variable).");
 
     // TODO:
-    // - check that the 'exclude' option works (if we keep it in core)
     // - check display order with several fields
   }
 
Index: modules/field/field.attach.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.attach.inc,v
retrieving revision 1.22
diff -u -r1.22 field.attach.inc
--- modules/field/field.attach.inc	7 Jun 2009 00:00:57 -0000	1.22
+++ modules/field/field.attach.inc	20 Jun 2009 17:51:04 -0000
@@ -902,17 +902,6 @@
 }
 
 /**
- * To be called in entity preprocessor.
- *
- * - Adds $FIELD_NAME_rendered variables
- *   containing the themed output for the whole field.
- * - Adds the formatted values in the 'view' key of the items.
- */
-function field_attach_preprocess($obj_type, $object) {
-  return _field_invoke_default('preprocess', $obj_type, $object);
-}
-
-/**
  * Implement hook_node_prepare_translation.
  *
  * TODO D7: We do not yet know if this really belongs in Field API.
Index: modules/field/field.default.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.default.inc,v
retrieving revision 1.7
diff -u -r1.7 field.default.inc
--- modules/field/field.default.inc	3 Jun 2009 02:41:07 -0000	1.7
+++ modules/field/field.default.inc	20 Jun 2009 17:51:05 -0000
@@ -70,7 +70,7 @@
  * designated as such in formatter_info().
  *
  * The $object array will look like:
- *   $object->content['field_foo']['wrapper'] = array(
+ *   $object->content['field_foo'] = array(
  *     '#theme' => 'field',
  *     '#title' => 'label'
  *     '#field_name' => 'field_name',
@@ -154,6 +154,7 @@
 
     $element = $info + array(
       '#theme' => 'field',
+      '#weight' => $instance['weight'],
       '#title' => check_plain(t($instance['label'])),
       '#access' => field_access('view', $field),
       '#label_display' => $label_display,
@@ -188,66 +189,11 @@
       $element['items'] += $format_info;
     }
 
-    // The wrapper lets us get the themed output for the whole field
-    // to populate the $FIELD_NAME_rendered variable for templates,
-    // and hide it from the $content variable if needed.
-    // See 'preprocess' op and theme_content_field_wrapper().
-    $wrapper = $info + array(
-      'field' => $element,
-      '#weight' => $instance['weight'],
-      '#post_render' => array('field_wrapper_post_render'),
-      '#context' => $context,
-    );
-
-    $addition = array($field['field_name'] => $wrapper);
+    $addition = array($field['field_name'] => $element);
   }
   return $addition;
 }
 
-/**
- * Hide excluded fields from the $content variable in templates.
- */
-function field_wrapper_post_render($content, $element) {
-  $instance = field_info_instance($element['#field_name'], $element['#bundle']);
-  if (theme('field_exclude', $content, $instance, $element['#context'])) {
-    return '';
-  }
-  return $content;
-}
-
-/**
- * 'Theme' function for a field's addition to the combined template output,
- * i.e. the node's $content or the user's $user_profile value.
- * This allows more flexibility in templates : you can use custom markup
- * around a few specific fields, and print the rest normally.
- *
- * This is a theme function, so it can be overridden in different
- * themes to produce different results.
- *
- * The html for individual fields are available in the $FIELD_NAME_rendered
- * variables.
- *
- * @return
- *   Whether or not the field's content is to be added in this context.
- *   Uses the 'exclude' value from the field's display settings.
- */
-function theme_field_exclude($content, $object, $context) {
-  if (empty($object['display'])
-    || empty($object['display'][$context])
-    || empty($object['display'][$context]['exclude'])) {
-    return FALSE;
-  }
-  else {
-    return TRUE;
-  }
-}
-
-function field_default_preprocess($obj_type, $object, $field, $instance, &$items) {
-  return array(
-    $field['field_name'] . '_rendered' => isset($object->content[$field['field_name']]['#children']) ? $object->content[$field['field_name']]['#children'] : '',
-  );
-}
-
 function field_default_prepare_translation($obj_type, $object, $field, $instance, &$items) {
   $addition = array();
   if (isset($object->translation_source->$field['field_name'])) {
Index: modules/field/field.crud.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.crud.inc,v
retrieving revision 1.15
diff -u -r1.15 field.crud.inc
--- modules/field/field.crud.inc	12 Jun 2009 08:39:36 -0000	1.15
+++ modules/field/field.crud.inc	20 Jun 2009 17:51:05 -0000
@@ -145,8 +145,6 @@
  *         - label (string)
  *             Position of the label. 'inline', 'above' and 'hidden' are the
  *             values recognized by the default 'field' theme implementation.
- *         - exclude (integer)
- *             TODO This is subject to change, see: http://drupal.org/node/367215
  *         - type (string)
  *             The type of the display formatter to use for the field in
  *             this context.
@@ -405,8 +403,6 @@
  *     Settings for the 'full' build mode will be added, and each build mode
  *     will be completed with the follwong default values:
  *     - label: 'above'
- *     - exclude: FALSE
- *       TODO This is subject to change, see: http://drupal.org/node/367215
  *     - type: the default formatter specified in hook_field_info().
  *     - settings: each omitted setting is given the default value specified in
  *       hook_field_formatter_info().
@@ -540,7 +536,6 @@
   foreach ($instance['display'] as $context => $display) {
     $instance['display'][$context] += array(
       'label' => 'above',
-      'exclude' => 0,
       // TODO: what if no 'default_formatter' specified ?
       'type' => $field_type['default_formatter'],
       'settings' => array(),
Index: modules/field/field.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.module,v
retrieving revision 1.13
diff -u -r1.13 field.module
--- modules/field/field.module	6 Jun 2009 16:17:30 -0000	1.13
+++ modules/field/field.module	20 Jun 2009 17:51:05 -0000
@@ -169,13 +169,6 @@
       'arguments' => array('element' => NULL),
       'path' => $path,
     ),
-    // TODO D7 : do we need exclude in core? See [#367215].
-    // This is just adding '#post_render' => array('field_wrapper_post_render')
-    // at the right places in the render array generated by field_default_view().
-    // Can be done in hook_field_attach_post_view if we want.
-    'field_exclude' => array(
-      'arguments' => array('content' => NULL, 'object' => array(), 'context' => NULL),
-    ),
     'field_multiple_value_form' => array(
       'arguments' => array('element' => NULL),
     ),
@@ -515,9 +508,7 @@
     $view = field_default_view($obj_type, $object, $field, $instance, $items, $teaser);
     // TODO : what about hook_field_attach_view ?
 
-    // field_default_view() adds a wrapper to handle variables and 'excluded'
-    // fields for node templates. We bypass it and return the actual field.
-    $output = $view[$field['field_name']]['field'];
+    $output = $view[$field['field_name']];
   }
   return $output;
 }
Index: modules/user/user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.40
diff -u -r1.40 user.pages.inc
--- modules/user/user.pages.inc	18 Jun 2009 21:19:02 -0000	1.40
+++ modules/user/user.pages.inc	20 Jun 2009 17:51:08 -0000
@@ -190,9 +190,6 @@
 function template_preprocess_user_profile(&$variables) {
   $account = $variables['elements']['#account'];
   $variables['user_profile'] = $account->content;
-
-  // Add $FIELD_NAME_rendered variables for fields.
-  $variables += field_attach_preprocess('user', $account);
 }
 
 /**
Index: modules/user/user-profile.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user-profile.tpl.php,v
retrieving revision 1.8
diff -u -r1.8 user-profile.tpl.php
--- modules/user/user-profile.tpl.php	19 Jun 2009 00:33:27 -0000	1.8
+++ modules/user/user-profile.tpl.php	20 Jun 2009 17:51:07 -0000
@@ -23,7 +23,6 @@
  *
  * Available variables:
  *   - $user_profile: An array of profile items. Use render() to print them.
- *   - TODO D7 : document $FIELD_NAME_rendered variables.
  *
  * @see template_preprocess_user_profile()
  */
