From adc5d834213ad8d7829fc8316fbf8b43ad3c0c67 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Tue, 19 Aug 2008 17:11:21 -0500 Subject: [PATCH] Fix for minor error in shelfbrowser queries Signed-off-by: Galen Charlton --- opac/opac-detail.pl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 7ba6c64875..4370ec3284 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; -- 2.39.5