Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.6.2.111
diff -u -p -r1.1.2.6.2.111 apachesolr_search.module
--- apachesolr_search.module	2 Jul 2009 21:58:34 -0000	1.1.2.6.2.111
+++ apachesolr_search.module	17 Aug 2009 17:10:32 -0000
@@ -597,6 +597,21 @@ function apachesolr_search_block($op = '
                 $terms[$term->vid][$active ? $countsort . $term->name : 1 + $countsort . $term->name] = $link;
               }
             }
+            // handle the case where tid is applied by the $response->facet_counts->facet_fields->$delta is empty so we can have an unclick link
+            if (empty($terms)) {
+              $term_filters = $query->get_filters('tid');
+              if (!empty($term_filters)) {
+                foreach ($term_filters as $filter) {
+                  $new_query = clone $query;
+                  $contains_active = TRUE;
+                  $term = taxonomy_get_term($filter['#value']);
+                  $new_query->remove_filter('tid', $filter['#value']);
+                  $options['query'] = $new_query->get_url_queryvalues();
+                  $link = theme('apachesolr_unclick_link', $term->name, $new_query->get_path(), $options);
+                  $terms[$term->vid][$filter['#value']] = $link;
+                }
+              }
+            }
           }
           $vid = substr($delta, 7);
           $vocab = taxonomy_vocabulary_load($vid);
