? .cache
? .settings
Index: modules/field/field.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.module,v
retrieving revision 1.61
diff -u -p -r1.61 field.module
--- modules/field/field.module	13 Jan 2010 05:40:03 -0000	1.61
+++ modules/field/field.module	13 Jan 2010 22:06:46 -0000
@@ -753,10 +753,16 @@ function template_preprocess_field(&$var
   $field_type_css = strtr($element['#field_type'], '_', '-');
   $field_name_css = strtr($element['#field_name'], '_', '-');
 
-  // Prepare an $items variable that the template can simply loop on.
-  // Filter out non-children properties that might have been added if the
-  // renderable array has gone through form_builder().
-  $items = array_intersect_key($element, array_flip(element_children($element)));
+  // Prepare an $items variable that the template can simply loop on. Filter
+  // out non-children properties that might have been added if the renderable
+  // array has gone through form_builder(). We rely on the fact that keys are
+  // numeric to provide a faster alternative to element_children().
+  $items = array();
+  foreach ($element as $key => $item) {
+    if (is_numeric($key)) {
+      $items[$key] = $item;
+    }
+  }
 
   $additions = array(
     'object' => $element['#object'],
@@ -784,7 +790,7 @@ function template_preprocess_field(&$var
       'field__' . $element['#field_name'] . '__' . $element['#bundle'],
     ),
   );
-  $variables = array_merge($variables, $additions);
+  $variables = $additions + $variables;
 
   // Initialize attributes for each item.
   $variables['item_attributes_array'] = array();
