Bug 19604: Fix perlcritic "Loop iterator is not lexical"
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 31 Jul 2018 11:21:00 +0000 (08:21 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 31 Jul 2018 13:44:36 +0000 (10:44 -0300)
Loop iterator is not lexical at line 318, column 13.  See page 108 of
PBP.  (Severity: 5)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm

index 5d7136c..4e6a6e9 100644 (file)
@@ -315,8 +315,8 @@ sub build_authorities_query {
             # regular wordlist stuff
 #            push @query_parts, { match => {$wh => { query => $val, operator => 'and' }} };
             my @values = split(' ',$val);
-            foreach $val (@values) {
-                push @query_parts, { wildcard => { "$wh.phrase" => "*" . lc $val . "*" } };
+            foreach my $v (@values) {
+                push @query_parts, { wildcard => { "$wh.phrase" => "*" . lc $v . "*" } };
             }
         }
     }