Permalink
Browse files

[Fixes #16684897] Holds queue displaying incorrect call numbers

This fix uses items.itemcallnumber instead of tmp_holdsqueue.itemcallnumber.
A schema change is needed in the future to use foreign keys instead of
static stale data.
  • Loading branch information...
hgq authored and ctfliblime committed May 11, 2011
1 parent b2cf986 commit 0e6799031cbeef40a32b7ec61018aaaa97836758
Showing with 5 additions and 1 deletion.
  1. +4 −0 C4/Reserves.pm
  2. +1 −1 koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tmpl
View
@@ -560,6 +560,8 @@ sub GetHoldsQueueItems
my $total = ($sth->fetchrow_array)[0];
my @bind_params = ();
+ ## FIXME: schema needs to change. tmp_holdsqueue should use foreign keys
+ ## here, use items.itemcallnumber instead of tmp_holdsqueue.itemcallnumber
my $query = q|SELECT
tmp_holdsqueue.*,
reserves.found,
@@ -569,6 +571,7 @@ sub GetHoldsQueueItems
items.enumchron,
items.cn_sort,
items.copynumber,
+ items.itemcallnumber as icallnumber,
biblioitems.publishercode,
biblio.copyrightdate,
biblioitems.publicationyear,
@@ -587,6 +590,7 @@ sub GetHoldsQueueItems
push @bind_params, $g{branch};
}
$g{orderby} ||= 'tmp_holdsqueue.reservedate';
+ $g{orderby} =~ s/items\.itemcallnumber/icallnumber/;
$query .= " ORDER BY $g{orderby}";
if ($g{limit}) {
$g{offset} ||= 0;
@@ -93,7 +93,7 @@ function Xport(barcode) {
</td>
<td><!-- TMPL_VAR NAME="ccode" --></td>
<td><!-- TMPL_VAR NAME="location" --></td>
- <td><!-- TMPL_VAR NAME="itemcallnumber"-->
+ <td><!-- TMPL_VAR NAME="icallnumber"-->
<!-- TMPL_VAR NAME="enumchron" -->
<!-- TMPL_VAR NAME="copynumber" --></td>
<td>

0 comments on commit 0e67990

Please sign in to comment.