[follow up](bug #3584) improve ccl detection
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Wed, 9 Sep 2009 07:29:03 +0000 (09:29 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Mon, 21 Sep 2009 20:36:34 +0000 (22:36 +0200)
This improve the detection of ccl queries, and do not duplicate the "ccl=" value.

C4/Search.pm

index 257f945..8f3410f 100644 (file)
@@ -1017,13 +1017,13 @@ sub buildQuery {
 
     my $cclq;
     my $indexes = getIndexes();
-    for my $index (@$indexes){
-        if($query =~ /($index)(,?\w)*:/){
-            $cclq = 1;
+    if( $query !~ /\s*ccl=/ ){
+        for my $index (@$indexes){
+            if($query =~ /($index)(,?\w)*:/){
+                $cclq = 1;
+            }
         }
-    }
-    if($cclq){
-        $query = "ccl=$query";
+        $query = "ccl=$query" if($cclq);
     }
 
 # for handling ccl, cql, pqf queries in diagnostic mode, skip the rest of the steps