From 0415a52a843a0c2db0686119b3d7aea361f1b75b Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Sun, 5 Feb 2017 16:11:30 -0500 Subject: [PATCH] Bug 18044: Label Batches not displaying SQL expects lists to be comma separated. A trailing comma must also be avoided. --- C4/Creators/Lib.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm index c15b3e7..eb97bc1 100644 --- a/C4/Creators/Lib.pm +++ b/C4/Creators/Lib.pm @@ -151,7 +151,7 @@ sub _build_query { $query .= ' WHERE 1 '; while ( my ( $field, $values ) = each %{ $params->{filters} } ) { if ( ref( $values ) ) { - $query .= " AND $field IN ( " . ( ('?') x scalar( @$values ) ) . " ) "; + $query .= " AND $field IN ( " . ( ('?,') x (@$values-1) ) . "? ) "; # a comma separates elements in a list... push @where_args, @$values; } else { $query .= " AND $field = ? "; -- 2.7.4