? SolrPhpClient
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.155.2.59
diff -u -p -r1.1.2.12.2.155.2.59 apachesolr.module
--- apachesolr.module	22 Mar 2010 16:55:07 -0000	1.1.2.12.2.155.2.59
+++ apachesolr.module	22 Mar 2010 17:25:43 -0000
@@ -384,9 +384,9 @@ function apachesolr_index_nodes($rows, $
   }
 
   // Flatten $documents
-  $tmp = (object) array('a' => array());
-  array_walk_recursive($documents, create_function('&$v, $k, &$t', '$t->a[] = $v;'), $tmp);
-  $documents = $tmp->a;
+  $tmp = array();
+  apachesolr_flatten_documents_array($documents, &$tmp);
+  $documents = $tmp;
 
   if (count($documents)) {
     try {
@@ -430,6 +430,25 @@ function apachesolr_date_iso($date_times
   return gmdate('Y-m-d\TH:i:s\Z', $date_timestamp);
 }
 
+/**
+ * Function to flatten documents array recursively.
+ *
+ * @param array $documents 
+ *   The array of documents being indexed.
+ * @param array &$tmp
+ *   A container variable that will contain the flattened array.
+ */
+function apachesolr_flatten_documents_array($documents, &$tmp) {
+  foreach ($documents AS $index => $item) {
+    if (is_array($item)) {
+      apachesolr_flatten_documents_array($item, $tmp);
+    }
+    else {
+      $tmp[] = $item;
+    }
+  }
+}
+
 function apachesolr_delete_node_from_index($node) {
   static $failed = FALSE;
   if ($failed) {
