Bug 10590 - parameterise the limit option
The limit option was previously substituted directly into the query. The previous patch on bug 10590 filters it on input, but there's no reason not to have it made to work properly in the query for added safety. To test: [1] Go to the top checkouts report (http://OPAC/cgi-bin/koha/opac-topissues.pl) [2] Run the report several times, varying the filters on number of results and item type. [3] Verify the the list of top checkouts appears to be correct. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Galen Charlton <gmc@esilibrary.com> (cherry picked from commit89cf013a6f) Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> (cherry picked from commit2e77edf8df) Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> (cherry picked from commit2e77edf8df) Signed-off-by: Chris Hall <followingthepath@gmail.com> (cherry picked from commitf5ee81028d)
This commit is contained in:
parent
5260c7fe3b
commit
55bb257cae
|
|
@ -82,7 +82,7 @@ if($advanced_search_types eq 'ccode'){
|
|||
GROUP BY biblio.biblionumber
|
||||
HAVING tot >0
|
||||
ORDER BY tot DESC
|
||||
LIMIT $limit
|
||||
LIMIT ?
|
||||
";
|
||||
$template->param(ccodesearch => 1);
|
||||
}else{
|
||||
|
|
@ -107,13 +107,13 @@ if($advanced_search_types eq 'ccode'){
|
|||
GROUP BY biblio.biblionumber
|
||||
HAVING tot >0
|
||||
ORDER BY tot DESC
|
||||
LIMIT $limit
|
||||
LIMIT ?
|
||||
";
|
||||
$template->param(itemtypesearch => 1);
|
||||
}
|
||||
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute();
|
||||
$sth->execute($limit);
|
||||
my @results;
|
||||
while (my $line= $sth->fetchrow_hashref) {
|
||||
push @results, $line;
|
||||
|
|
|
|||
Loading…
Reference in New Issue