? SolrPhpClient/.svn
? SolrPhpClient/Apache/.svn
? SolrPhpClient/Apache/Solr/.svn
? SolrPhpClient/Apache/Solr/Service/.svn
? contrib/.svn
? contrib/apachesolr_attachments/.svn
? contrib/apachesolr_image/.svn
? contrib/apachesolr_lang/.svn
? contrib/apachesolr_mlt/.svn
? contrib/apachesolr_multisitesearch/.svn
? contrib/apachesolr_nodeaccess/.svn
? contrib/apachesolr_nodeaccess/tests/.svn
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.76
diff -u -p -r1.1.2.12.2.76 apachesolr.module
--- apachesolr.module	16 Dec 2008 13:53:55 -0000	1.1.2.12.2.76
+++ apachesolr.module	17 Dec 2008 18:26:43 -0000
@@ -676,7 +676,7 @@ function apachesolr_block($op = 'list', 
           return;
         }
 
-        $query = apachesolr_drupal_query();
+        $query = apachesolr_current_query();
 
         // Get information needed by the rest of the blocks about limits.
         $facet_display_limits = variable_get('apachesolr_facet_query_limits', array());
@@ -906,15 +906,34 @@ function apachesolr_static_response_cach
 /**
  * Factory function for query objects.
  *
- * The query object is built from the keys. If you want to build queries
- * programmatically you can pass in different keys. If you don't pass in
- * any keys, search_get_keys() is used instead.
+ * The query object is built from the keys, filters, and sort.
  */
-function apachesolr_drupal_query($keys = '', $filters = '', $solrsort = '', $reset = FALSE) {
-  static $_queries;
+function apachesolr_drupal_query($keys = '', $filters = '', $solrsort = '') {
+
+  list($module, $class) = variable_get('apachesolr_query_class', array('apachesolr', 'Solr_Base_Query'));
+  include_once drupal_get_path('module', $module) .'/'. $class .'.php';
+
+  try {
+    $query = new $class(apachesolr_get_solr(), $keys, $filters, $solrsort);
+  }
+  catch (Exception $e) {
+    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    $query = NULL;
+  }
+  return $query;
+}
+
+/**
+ * Factory function for query objects representing the current search URL.
+ *
+ * The query object is built from the keys in the URL, but these may be
+ * overridden by passing in parameters.
+ */
+function apachesolr_current_query($keys = '', $filters = '', $solrsort = '', $reset = FALSE) {
+  static $_queries = array();
 
   if ($reset) {
-    unset($_queries);
+    $_queries = array();
   }
 
   if (empty($keys)) {
@@ -928,19 +947,10 @@ function apachesolr_drupal_query($keys =
   }
   $index = $keys . '&filters=' . $filters;
 
-  if (empty($_queries) || empty($_queries[$index])) {
-    list($module, $class) = variable_get('apachesolr_query_class', array('apachesolr', 'Solr_Base_Query'));
-    include_once drupal_get_path('module', $module) .'/'. $class .'.php';
-
-    try {
-      $_queries[$index] = new $class(apachesolr_get_solr(), $keys, $filters, $solrsort);
-    }
-    catch (Exception $e) {
-      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
-      return;
-    }
+  if (empty($_queries) || !array_key_exists($index, $_queries)) {
+    $_queries[$index] = apachesolr_drupal_query($keys, $filters, $solrsort);
   }
-  return $_queries[$index];
+  return is_object($_queries[$index]) ? clone $_queries[$index] : $_queries[$index];
 }
 
 /**
Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.6.2.48
diff -u -p -r1.1.2.6.2.48 apachesolr_search.module
--- apachesolr_search.module	16 Dec 2008 15:52:41 -0000	1.1.2.6.2.48
+++ apachesolr_search.module	17 Dec 2008 18:26:44 -0000
@@ -75,7 +75,7 @@ function apachesolr_search_search($op = 
 
       try {
         // This is the object that knows about the query coming from the user.
-        $query = apachesolr_drupal_query($keys);
+        $query = apachesolr_current_query($keys);
         if (is_null($query)) {
           throw new Exception(t('Could not construct a Solr query in function apachesolr_search_search()'));
         }
@@ -211,7 +211,10 @@ function apachesolr_search_search($op = 
           return array();
         }
         // An arry of fq parameters.
-        $params['fq'] = $query->get_fq();
+        $fq = $query->get_fq();
+        if ($fq) {
+          $params['fq'] = $fq;
+        }
 
         $response = $solr->search($query->get_query_basic(), $params['start'], $params['rows'], $params);
         // The response is cached so that it is accessible to the blocks and anything
@@ -299,7 +302,7 @@ function apachesolr_search_block($op = '
         if (empty($response)) {
           return;
         }
-        $query = apachesolr_drupal_query();
+        $query = apachesolr_current_query();
 
         // Get information needed by the rest of the blocks about limits.
         $facet_display_limits = variable_get('apachesolr_facet_query_limits', array());
@@ -459,7 +462,7 @@ function apachesolr_search_form_search_f
 
     if ($suggestions) {
       //Get the original query and replace words.
-      $query = apachesolr_drupal_query();
+      $query = apachesolr_current_query();
 
       foreach($suggestions as $word => $value) {
         $replacements[$word] = $value->suggestion[0];
Index: contrib/apachesolr_lang/apachesolr_lang.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/contrib/apachesolr_lang/Attic/apachesolr_lang.module,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 apachesolr_lang.module
--- contrib/apachesolr_lang/apachesolr_lang.module	4 Nov 2008 14:37:49 -0000	1.1.2.1
+++ contrib/apachesolr_lang/apachesolr_lang.module	17 Dec 2008 18:26:45 -0000
@@ -15,11 +15,11 @@ function apachesolr_lang_block($op = 'li
     case 'view':
       if (apachesolr_has_searched()) {
         // Get the query and response. Without these no blocks make sense.
-        $response =& apachesolr_static_response_cache();
+        $response = apachesolr_static_response_cache();
         if (empty($response)) {
           return;
         }
-        $query =& apachesolr_drupal_query();
+        $query = apachesolr_current_query();
         
         switch ($delta) {
           case 'language':
Index: contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/contrib/apachesolr_nodeaccess/Attic/apachesolr_nodeaccess.info,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 apachesolr_nodeaccess.info
--- contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.info	4 Dec 2008 22:02:43 -0000	1.1.2.2
+++ contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.info	17 Dec 2008 18:26:45 -0000
@@ -3,5 +3,4 @@ name = ApacheSolr Node Access
 description = Integrates Node Access and ApacheSolr
 dependencies[] = apachesolr
 package = ApacheSolr
-;don't use until it's fixed for new APIs 
-;core = "6.x"
+core = "6.x"
Index: contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/contrib/apachesolr_nodeaccess/Attic/apachesolr_nodeaccess.module,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 apachesolr_nodeaccess.module
--- contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module	9 Dec 2008 01:01:29 -0000	1.1.2.3
+++ contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module	17 Dec 2008 18:26:45 -0000
@@ -22,17 +22,14 @@ function apachesolr_nodeaccess_apachesol
  */
 function _apachesolr_nodeaccess_build_subquery($account) {
   if (!user_access('administer nodes', $account) && count(module_implements('node_grants'))) {
-    // Get node access perms
-    $query = apachesolr_drupal_query();
-    $node_access_query = clone $query;
-
+    // Get node access perms 
     $grants = node_access_grants('view', $account);
     if (empty($grants)) {
       // If they can't see any content, we might as well not bother searching.
       // Catch the exception to null out the query.
       throw new Exception("This user cannot access any content!");
     }
-
+    $node_access_query = apachesolr_drupal_query();
     foreach ($grants as $realm => $gids) {
       foreach ($gids as $gid) {
         $node_access_query->add_field('nodeaccess_' . $realm, $gid);
