X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FVirtualShelves.pm;h=57b86daba38f6dd713d339747e0a45b35f48dbac;hb=e23608a1f90b7d25068870e82a19721fd70e60a5;hp=df54de87c3d0dbb4e3ed4f413f9bbb39335c58a1;hpb=6c0962f06b35d897fc0e1f2276182feeb3124c6f;p=koha.git diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index df54de87c3..57b86daba3 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -203,15 +203,19 @@ sub GetRecentShelves { my @params; my $selection; if (defined $owner) { - @params = ($owner, $mincategory, $row_count); + @params = ($owner, $mincategory); $selection = ' WHERE owner = ? AND category = ?'; } else { - @params = ( $mincategory, $row_count); + @params = ( $mincategory); $selection = ' WHERE category >= ? '; } my $query = 'SELECT * FROM virtualshelves'; $query .= $selection; - $query .= ' ORDER BY lastmodified DESC LIMIT ?'; + $query .= ' ORDER BY lastmodified DESC'; + if ($row_count){ + $query .= ' LIMIT ?'; + push @params,$row_count; + } my $sth = $dbh->prepare($query); $sth->execute(@params); my $shelflist = $sth->fetchall_arrayref({});