Index: apachesolr.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v retrieving revision 1.1.2.12.2.169 diff -u -p -r1.1.2.12.2.169 apachesolr.module --- apachesolr.module 22 Oct 2009 14:05:02 -0000 1.1.2.12.2.169 +++ apachesolr.module 25 Oct 2009 18:01:11 -0000 @@ -1041,6 +1041,10 @@ function apachesolr_facetcount_save($edi * } */ function apachesolr_modify_query(&$query, &$params, $caller) { + if (empty($query)) { + // This should only happen if Solr is not set up - avoids fatal errors. + return; + } foreach (module_implements('apachesolr_modify_query') as $module) { $function_name = $module . '_apachesolr_modify_query'; Index: Drupal_Apache_Solr_Service.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Drupal_Apache_Solr_Service.php,v retrieving revision 1.1.2.21 diff -u -p -r1.1.2.21 Drupal_Apache_Solr_Service.php --- Drupal_Apache_Solr_Service.php 14 Oct 2009 19:08:19 -0000 1.1.2.21 +++ Drupal_Apache_Solr_Service.php 25 Oct 2009 18:01:12 -0000 @@ -185,6 +185,32 @@ class Drupal_Apache_Solr_Service extends } /** + * Send a post to a servlet (a path) that's not a standard path. + * + * @param string $servlet + * @param array $params + * @param array $headers + * @param string $rawPost + * @param float $timeout Read timeout in seconds + * @return response object + */ + public function sendServletPost($servlet, $params = array(), $headers = array(), $rawPost = '', $timeout = FALSE) { + $url = $this->_constructUrl($servlet, $params); + list ($data, $headers) = $this->_makeHttpRequest($url, 'POST', $headers, $rawPost, $timeout); + $response = new Apache_Solr_Response($data, $headers, $this->_createDocuments, $this->_collapseSingleValueArrays); + $code = (int) $response->getHttpStatus(); + if ($code != 200) { + $message = $response->getHttpStatusMessage(); + if ($code >= 400 && $code != 403 && $code != 404) { + // Add details, like Solr's exception message. + $message .= $response->getRawResponse(); + } + throw new Exception('"' . $code . '" Status: ' . $message); + } + return $response; + } + + /** * Put Luke meta-data from the cache into $this->luke when we instantiate. * * @see Apache_Solr_Service::__construct()