From a76fe18ca4b288d27b26f8f150817af2adb04b16 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. Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 544cf17d6f3279d95835ba42d40d49982e97f0a2) Signed-off-by: Katrin Fischer (cherry picked from commit b61ff540611f0dfd28dd7818dc1d03062cb4c159) Signed-off-by: Julian Maurice --- 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 4441c89d00..e90dd6628b 100644 --- a/C4/Creators/Lib.pm +++ b/C4/Creators/Lib.pm @@ -152,7 +152,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.39.5