Procházet zdrojové kódy

bugfixe : autocomplete and guillemets

Bachir Soussi Chiadmi před 9 roky
rodič
revize
ef50154a49
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      materio_search_api.pages.inc

+ 4 - 1
materio_search_api.pages.inc

@@ -71,7 +71,10 @@ function materio_search_api_autocomplete_searchapi($typed = ''){
     // search for patterns like key -another key +lastkey
     // and provide auto completion for the last key
     preg_match_all('/\s?[\+|-]?[^\s]+/', $typed, $adv_search_q);
+    // dsm($adv_search_q, "adv_search_q");
     preg_match('/^(\+|-)?(.*)$/', trim(array_pop($adv_search_q[0])), $last);
+    // dsm($last, "last");
+
     $tosearch = isset($last[2]) ? $last[2] : $typed;
 
     // build the query
@@ -97,7 +100,7 @@ function materio_search_api_autocomplete_searchapi($typed = ''){
         //$term_matches[$item->tid] = check_plain($item->name);
         // $term_matches[check_plain($item->name)] = check_plain($item->name);
         // TODO:  leave tags with nodes
-        $term_matches[ '"'.trim(implode(' ', $adv_search_q[0]).' '.$last[1].$item->name).'"'] = check_plain($item->name);
+        $term_matches[trim(implode(' ', $adv_search_q[0]).' "'.$last[1].$item->name).'"'] = check_plain($item->name);
 
         $delta++;
         if($delta > 15)