Index: modules/field/field.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v
retrieving revision 1.17
diff -u -p -r1.17 field.api.php
--- modules/field/field.api.php	30 Jun 2009 03:12:03 -0000	1.17
+++ modules/field/field.api.php	7 Jul 2009 12:17:43 -0000
@@ -294,6 +294,22 @@ function hook_field_load($obj_type, $obj
 }
 
 /**
+ * Allow formatters to load information for multiple objects.
+ *
+ * This should be used when a formatter needs to load additional information
+ * from the database in order to render a field, for example a reference field
+ * which displays properties of the referenced objects such as name or type.
+ * Information should be added as properties of the loaded objects.
+ *
+ * @param $object
+ *   An array of the objects to be displayed, keyed by object ID.
+ * @param $formatter
+ *   The formatter array for this instance.
+ */
+function hook_field_formatter_load($objects, $formatter) {
+}
+
+/**
  * Define custom validate behavior for this module's field types.
  *
  * @param $obj_type
Index: modules/field/field.attach.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.attach.inc,v
retrieving revision 1.29
diff -u -p -r1.29 field.attach.inc
--- modules/field/field.attach.inc	7 Jul 2009 09:28:07 -0000	1.29
+++ modules/field/field.attach.inc	7 Jul 2009 12:17:44 -0000
@@ -475,6 +475,13 @@ function field_attach_load($obj_type, $o
 }
 
 /**
+ * Allow formatters to act on fieldable objects prior to rendering.
+ */
+function field_attach_formatter_load($obj_type, $objects, $build_mode) {
+  _field_invoke_multiple_default('formatter_load', $obj_type, $objects, $build_mode);
+}
+
+/**
  * Load all fields for a previous version of each of a set of
  * objects of a single object type.
  *
Index: modules/field/field.default.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.default.inc,v
retrieving revision 1.9
diff -u -p -r1.9 field.default.inc
--- modules/field/field.default.inc	24 Jun 2009 18:16:38 -0000	1.9
+++ modules/field/field.default.inc	7 Jul 2009 12:17:44 -0000
@@ -58,6 +58,30 @@ function field_default_insert($obj_type,
 }
 
 /**
+ * Find the correct formatter to use when preparing objects for rendering
+ * and allow it to load additional properties into the objects.
+ */
+function field_default_formatter_load($obj_type, $objects, $field, $instances, $items, $build_mode) {
+
+  // Since formatters need to be applied per bundle, build an array of
+  // formatters and objects to pass to hook_field_formatter_load().
+  $formatters = array();
+  foreach ($instances as $id => $instance) {
+    $formatter = isset($instance['display'][$build_mode]) ? $instance['display'][$build_mode] : $instance['display']['full'];
+    $formatters[$formatter['type']]['formatter'] = $formatter;
+    $formatters[$formatter['type']]['objects'][$id] = $objects[$id];
+  }
+
+  foreach ($formatters as $formatter) {
+    // Invoke hook_field_formatter_load().
+    $function = $formatter['formatter']['type'] . '_field_formatter_load';
+    if (drupal_function_exists($function)) {
+      $function($formatter['objects'], $formatter['formatter']);
+    }
+  }
+}
+
+/**
  * The 'view' operation constructs the $object in a way that you can use
  * drupal_render() to display the formatted output for an individual field.
  * i.e. print drupal_render($object->content['field_foo']);
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1079
diff -u -p -r1.1079 node.module
--- modules/node/node.module	5 Jul 2009 18:00:09 -0000	1.1079
+++ modules/node/node.module	7 Jul 2009 12:17:45 -0000
@@ -1181,7 +1181,7 @@ function node_show($node, $message = FAL
   node_tag_new($node->nid);
 
   // For markup consistency with other pages, use node_build_multiple() rather than node_build().
-  return node_build_multiple(array($node), 'full');
+  return node_build_multiple(array($node->nid => $node), 'full');
 }
 
 /**
@@ -1950,6 +1950,7 @@ function node_feed($nids = FALSE, $chann
  *   An array in the format expected by drupal_render().
  */
 function node_build_multiple($nodes, $build_mode = 'teaser', $weight = 0) {
+  field_attach_formatter_load('node', $nodes, $build_mode);
   $build = array();
   foreach ($nodes as $node) {
     $build['nodes'][$node->nid] = node_build($node, $build_mode);
Index: modules/taxonomy/taxonomy.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v
retrieving revision 1.30
diff -u -p -r1.30 taxonomy.pages.inc
--- modules/taxonomy/taxonomy.pages.inc	28 Jun 2009 13:37:29 -0000	1.30
+++ modules/taxonomy/taxonomy.pages.inc	7 Jul 2009 12:17:46 -0000
@@ -54,6 +54,8 @@ function taxonomy_term_page($terms, $dep
           // confusion.
           if (count($tids) == 1) {
             $term = taxonomy_term_load($tids[0]);
+            $objects = array($term->tid => $term);
+            field_attach_formatter_load('taxonomy_term', $objects, 'full');
             $build += field_attach_view('taxonomy_term', $term);
             if (!empty($term->description)) {
               $build['term_description'] = array(
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1008
diff -u -p -r1.1008 user.module
--- modules/user/user.module	5 Jul 2009 18:07:04 -0000	1.1008
+++ modules/user/user.module	7 Jul 2009 12:17:48 -0000
@@ -1990,7 +1990,9 @@ function _user_cancel($edit, $account, $
  * @return
  *   A structured array containing the individual elements of the profile.
  */
-function user_build_content(&$account) {
+function user_build_content($account) {
+  $accounts = array($account->uid, $account);
+  field_attach_formatter_load('user', $accounts, 'full');
   $edit = NULL;
   $account->content = array();
 
@@ -2002,8 +2004,6 @@ function user_build_content(&$account) {
 
   // Allow modules to modify the fully-built profile.
   drupal_alter('profile', $account);
-
-  return $account->content;
 }
 
 /**
