commit 74649f82cc4fec5585ccd1cef4e9decb0168b19c
Author: pwolanin <pwolanin@49851.no-reply.drupal.org>
Date:   Mon Jun 13 12:40:33 2011 -0400

    Issue #1148612 by pwolanin: fix regression Clicking "Relevancy" has no effect after choosing another sort.

diff --git a/Solr_Base_Query.php b/Solr_Base_Query.php
index c0e2613..f4802a4 100644
--- a/Solr_Base_Query.php
+++ b/Solr_Base_Query.php
@@ -202,7 +202,7 @@ class SolrBaseQuery extends SolrFilterSubQuery implements DrupalSolrQueryInterfa
     $this->addParams($params);
     $this->available_sorts = $this->defaultSorts();
     $this->sortstring = trim($sortstring);
-    $this->parseSortstring();
+    $this->parseSortString();
     $this->base_path = $base_path;
   }
 
@@ -425,7 +425,7 @@ class SolrBaseQuery extends SolrFilterSubQuery implements DrupalSolrQueryInterfa
     // We expect non-aliased sorts to be added.
     $this->available_sorts[$name] = $sort;
     // Re-parse the sortstring.
-    $this->parseSortstring();
+    $this->parseSortString();
     return $this;
   }
 
@@ -442,7 +442,7 @@ class SolrBaseQuery extends SolrFilterSubQuery implements DrupalSolrQueryInterfa
 
   public function setSolrsort($name, $direction) {
     $this->sortstring = trim($name) . ' ' . trim($direction);
-    $this->parseSortstring();
+    $this->parseSortString();
     return $this;
   }
 
@@ -456,7 +456,7 @@ class SolrBaseQuery extends SolrFilterSubQuery implements DrupalSolrQueryInterfa
   public function getSolrsortUrlQuery() {
     $queryvalues = array();
     $solrsort = $this->solrsort;
-    if ($solrsort && ($solrsort['#name'] != 'score' || $solrsort['#direction'] != 'desc')) {
+    if ($solrsort && ($solrsort['#name'] != 'score')) {
       if (isset($this->field_map[$solrsort['#name']])) {
         $solrsort['#name'] = $this->field_map[$solrsort['#name']];
       }
diff --git a/apachesolr.module b/apachesolr.module
index fb01e7e..e3b95b5 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -980,7 +980,7 @@ function apachesolr_block_view($delta = '') {
       }
       $new_query->setSolrsort($name, $new_direction);
       $sort_links[$name] = array(
-        'title' => $sort['title'],
+        'text' => $sort['title'],
         'path' => $path,
         'options' => array('query' => $new_query->getSolrsortUrlQuery()),
         'active' => $active,
@@ -990,12 +990,7 @@ function apachesolr_block_view($delta = '') {
     // Allow other modules to add or remove sorts.
     drupal_alter('apachesolr_sort_links', $sort_links);
     foreach ($sort_links as $name => $link) {
-      $themed_links[$name] = theme('apachesolr_sort_link', array(
-        'text' => $link['title'],
-        'path' => $link['path'],
-        'options' => $link['options'],
-        'active' => $link['active'],
-        'direction' => $link['direction']));
+      $themed_links[$name] = theme('apachesolr_sort_link', $link);
     }
     return array(
     'subject' => t('Sort by'),
@@ -2077,7 +2072,7 @@ function apachesolr_l($text, $path, $options = array()) {
   unset($options['attributes']['title']);
 
   // Retain GET parameters that Apache Solr knows nothing about.
-  $get = array_diff_key($_GET, array('q' => 1, 'page' => 1), $options['query']);
+  $get = array_diff_key($_GET, array('q' => 1, 'page' => 1, 'solrsort' => 1), $options['query']);
   $options['query'] += $get;
 
   return '<a href="' . check_url(url($path, $options)) . '"' . drupal_attributes($options['attributes']) . '>' . ($options['html'] ? $text : check_plain(html_entity_decode($text))) . '</a>';
