Bug 27380: Move get_prepped_report to object and use for svc/reports
[koha-ffzg.git] / C4 / Reports / Guided.pm
index 7bc1504..a76d86b 100644 (file)
@@ -557,6 +557,18 @@ sub execute_query {
         return (undef, { queryerr => 'Missing SELECT'} );
     }
 
+    foreach my $sql_param ( @$sql_params ){
+        if ( $sql_param =~ m/\n/ ){
+            my @list = split /\n/, $sql_param;
+            my @quoted_list;
+            foreach my $item ( @list ){
+                $item =~ s/\r//;
+              push @quoted_list, C4::Context->dbh->quote($item);
+            }
+            $sql_param = "(".join(",",@quoted_list).")";
+        }
+    }
+
     my ($useroffset, $userlimit);
 
     # Grab offset/limit from user supplied LIMIT and drop the LIMIT so we can control pagination