Bug 8233: Replace the given statement with for
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 22 Jun 2012 14:38:20 +0000 (16:38 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 6 Jul 2012 14:53:47 +0000 (16:53 +0200)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Koha/SearchEngine/Solr/QueryBuilder.pm
opac/opac-search.pl

index ba653b3..414d1e1 100644 (file)
@@ -43,7 +43,7 @@ sub build_advanced_query {
         # And others
         $index_name = @$indexes[$i] if @$indexes[$i];
         my $operator = defined @$operators[$i-1] ? @$operators[$i-1] : 'AND';
-        given ( uc ( $operator ) ) {
+        for ( uc ( $operator ) ) {
             when ('OR'){
                 $q .= BuildTokenString($index_name, $kw, 'OR');
             }
index 8028c0a..e39e547 100755 (executable)
@@ -30,7 +30,7 @@ use Modern::Perl;
 use C4::Context;
 
 my $searchengine = C4::Context->preference("SearchEngine");
-given ( $searchengine ) {
+for ( $searchengine ) {
     when ( /^Solr$/ ) {
         warn "We use Solr";
         require 'opac/search.pl';