From 32317878c0e2cbf858e8a21466d01ab3c4df3aec Mon Sep 17 00:00:00 2001 From: Christophe Croullebois Date: Thu, 27 Oct 2011 15:50:19 +0200 Subject: [PATCH] Bug 7105: Bad request in GetSubscriptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If $string or $issn is passed to GetSubscriptions, the request is false. See Bug 5864, especially the last comment from Frédérick Capovilla. Signed-off-by: Julian Maurice Signed-off-by: Paul Poulain --- C4/Serials.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 18e0ce4c05..147118498d 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -588,7 +588,7 @@ sub GetSubscriptions { $tmpstring =~ s/^AND //; push @sqlstrings, $tmpstring; } - $sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "(" . join( ") OR (", @sqlstrings ) . ")"; + $sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "((" . join( ") OR (", @sqlstrings ) . "))"; } if ($issn) { my @sqlstrings; @@ -601,7 +601,7 @@ sub GetSubscriptions { $tmpstring =~ s/^OR //; push @sqlstrings, $tmpstring; } - $sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "(" . join( ") OR (", @sqlstrings ) . ")"; + $sqlwhere .= ( $sqlwhere ? " AND " : " WHERE " ) . "((" . join( ") OR (", @sqlstrings ) . "))"; } $sql .= "$sqlwhere ORDER BY title"; $debug and warn "GetSubscriptions query: $sql params : ", join( " ", @bind_params ); -- 2.39.5