Apr 16, 2008 2:33:51 PM org.apache.solr.core.SolrCore execute
INFO: /admin/luke numTerms=0 0 1

CommentFileSizeAuthor
#1 formalter_fix.patch3.67 KBrobertdouglass

Comments

robertdouglass’s picture

Status: Active » Fixed
StatusFileSize
new3.67 KB

Found it in form_alter. If anyone can help solve the deeper issue as noted in the code comment, please let me know:

function apachesolr_form_alter($form_id, &$form) {
  $arg = arg(1);
  $alias = drupal_lookup_path('alias', "search/{$arg}");
  // Ok, this really sucks. I want a way to know whether the action of the form
  // is suposed to be handled by an ApacheSolr module or not. I manually
  // exclude node and user here, but there are many other hook_search implementations
  // in the wild and this code will potentially interfere with them. It also
  // creates a Solr instance wasting resources.
  if ($arg != 'node' && $arg != 'user' && (
      preg_match("&/search/{$arg}&", $form['#action']) ||
      preg_match("&/{$alias}&", $form['#action'])  ||
      strpos($form['#action'], $alias))) {
    if (!isset($_POST['form_id'])) {
      // Set up our validation function
      $form['#validate']['apachesolr_search_validate'] = array();

      // if no keys, there's nothing to do.
      if (empty($form['basic']['inline']['keys']['#default_value'])) {
        return;
      }

      // The $query is the true source for search key information
      if ($query =& apachesolr_drupal_query()) {
        $form['basic']['inline']['keys']['#default_value'] = $query->get_query_basic();
      }
    }
  }
}

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.