Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.51
diff -u -p -r1.1.2.51 apachesolr.module
--- apachesolr.module	3 Feb 2009 15:38:38 -0000	1.1.2.51
+++ apachesolr.module	18 Mar 2009 01:24:13 -0000
@@ -240,7 +240,7 @@ function apachesolr_delete_index_form_su
       variable_del('apachesolr_last_id');
       // This form can't be seen by anyone without 'administer site configuration'
       // permission, so no need to check perms before displaying a run-cron link.
-      drupal_set_message(t('The Solr content index has been erased. You must now !run_cron until your entire site has been re-indexed.', array('!run_cron' => l(t('run cron'), 'admin/logs/status/run-cron', array('fragment' => 'module-user')))));
+      drupal_set_message(t('The Solr content index has been erased. You must now !run_cron until your entire site has been re-indexed.', array('!run_cron' => l(t('run cron'), 'admin/reports/status/run-cron', array('query' => array('destination' => 'admin/settings/apachesolr/index'))))));
     }
     catch (Exception $e) {
       watchdog('Apache Solr', $e->getMessage(), WATCHDOG_ERROR);
@@ -377,26 +377,25 @@ class ApacheSolrUpdate {
             }
           }
 
-          if ($cck_fields && strpos($key, 'field_') === 0) {
-            // Got a CCK field. See if it is to be indexed.
-            if (in_array($key, array_keys($cck_fields))) {
-              $function = $cck_fields[$key]['callback'];
-              if ($cck_fields[$key]['callback'] && function_exists($function)) {
-                $dynamic_fields = call_user_func_array($function, array($node, $key));
+          foreach ($cck_fields as $key => $cck_info) {
+            if (isset($node->$key)) {
+              // Got a CCK field. See if it is to be indexed.
+              $function = $cck_info['callback'];
+              if ($cck_info['callback'] && function_exists($function)) {
+                $field = call_user_func_array($function, array($node, $key));
               }
               else {
-                $dynamic_fields = $node->$key;
+                $field = $node->$key;
               }
-              if (is_array($dynamic_fields) && count($dynamic_fields) > 0) {
-                foreach ($dynamic_fields as $field) {
-                  if (!empty($field['view'])) {
-                    $index_key = apachesolr_index_key($cck_fields[$key]);
-                    if ($cck_fields[$key]['multiple']) {
-                      $document->setMultiValue($index_key, $field['view']);
-                    }
-                    else {
-                      $document->$index_key = $field['view'];
-                    }
+              $index_key = apachesolr_index_key($cck_info);
+              foreach ($field as $value) {
+                // Don't index NULLs or empty strings
+                if (isset($value['view']) && strlen($value['view'])) {
+                  if ($cck_info['multiple']) {
+                    $document->setMultiValue($index_key, $value['view']);
+                  }
+                  else {
+                    $document->$index_key = $value['view'];
                   }
                 }
               }
@@ -566,7 +565,7 @@ function apachesolr_block($op = 'list', 
 }
 
 function apachesolr_facet_block($response, $query, $delta, $filter_by, $facet_callback = FALSE) {
-  if (is_object($response->facet_counts->facet_fields->$delta)) {
+  if (!empty($response->facet_counts->facet_fields->$delta)) {
     $contains_active = FALSE;
     $items = array();
     foreach ($response->facet_counts->facet_fields->$delta as $facet => $count) {
@@ -820,7 +819,7 @@ function apachesolr_cck_fields() {
     return $_fields;
   }
   else {
-    return FALSE;
+    return array();
   }
 }
 
Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.22
diff -u -p -r1.1.2.22 apachesolr_search.module
--- apachesolr_search.module	22 Nov 2008 12:58:07 -0000	1.1.2.22
+++ apachesolr_search.module	18 Mar 2009 01:24:13 -0000
@@ -285,9 +285,9 @@ function apachesolr_search_block($op = '
             foreach ($fields as $name => $field) {
               $index_key = apachesolr_index_key($field);
               if ($index_key == $delta) {
-                if (is_array($response->facets->$index_key)) {
+                if (!empty($response->facet_counts->facet_fields->$index_key)) {
                   $contains_active = FALSE;
-                  foreach ($response->facets->$index_key as $facet => $count) {
+                  foreach ($response->facet_counts->facet_fields->$index_key as $facet => $count) {
                     $unclick_link = '';
                     unset($active);
                     $new_query = clone $query;
