[Koha-patches] [PATCH] Fix for minor error in shelfbrowser queries
Jesse Weaver
jesse.weaver at liblime.com
Wed Aug 20 00:11:21 CEST 2008
---
opac/opac-detail.pl | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index 7ba6c64..4370ec3 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -322,7 +322,7 @@ if (C4::Context->preference("OPACShelfBrowser")) {
WHERE
((cn_sort = ? AND itemnumber < ?) OR cn_sort < ?) AND
homebranch = ? AND location = ?
- ORDER BY cn_sort DESC, itemnumber ASC LIMIT 3
+ ORDER BY cn_sort DESC, itemnumber LIMIT 3
");
$sth_shelfbrowse_previous->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
my @previous_items;
@@ -338,9 +338,7 @@ if (C4::Context->preference("OPACShelfBrowser")) {
}
}
unshift @previous_items, $this_item;
- warn "p$this_item->{itemnumber}" . '@' . "$this_item->{biblionumber}: $this_item->{cn_sort}";
}
- warn "p: " . (@previous_items ? 'yes' : 'no');
## List of Next Items; this also intentionally catches the current item
my $sth_shelfbrowse_next = $dbh->prepare("
@@ -349,7 +347,7 @@ if (C4::Context->preference("OPACShelfBrowser")) {
WHERE
((cn_sort = ? AND itemnumber >= ?) OR cn_sort > ?) AND
homebranch = ? AND location = ?
- ORDER BY cn_sort DESC, itemnumber ASC LIMIT 3
+ ORDER BY cn_sort, itemnumber LIMIT 3
");
$sth_shelfbrowse_next->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
my @next_items;
@@ -365,9 +363,7 @@ if (C4::Context->preference("OPACShelfBrowser")) {
}
}
push @next_items, $this_item;
- warn "n$this_item->{itemnumber}" . '@' . "$this_item->{biblionumber}: $this_item->{cn_sort}";
}
- warn "n: " . (@next_items ? 'yes' : 'no');
# alas, these won't auto-vivify, see http://www.perlmonks.org/?node_id=508481
my $shelfbrowser_next_itemnumber = $next_items[-1]->{itemnumber} if @next_items;
--
1.5.5.GIT
More information about the Koha-patches
mailing list