[Koha-patches] [PATCH] Bug 8479 Calculate rank irrespective of display option

Colin Campbell colin.campbell at ptfs-europe.com
Fri Jul 20 12:36:03 CEST 2012


Calculation of rank was being skipped based on display
option but it is used in calculating the rank passed
to AddReserve resulting in reserves being created with
null priorities causing them to be skipped in subsequent
processing
---
 opac/opac-reserve.pl | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl
index 1fb4df0..2bbb4be 100755
--- a/opac/opac-reserve.pl
+++ b/opac/opac-reserve.pl
@@ -147,22 +147,20 @@ foreach my $biblioNumber (@biblionumbers) {
         $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
     }
 
-    if ($show_holds_count) {
-        # Compute the priority rank.
-        my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1);
-        $biblioData->{reservecount} = 1; # new reserve
-        foreach my $res (@$reserves) {
-            my $found = $res->{'found'};
-            if ( $found && ($found eq 'W') ) {
-                $rank--;
-            }
-            else {
-                $biblioData->{reservecount}++;
-            }
+    # Compute the priority rank.
+    my ( $rank, $reserves ) =
+      GetReservesFromBiblionumber( $biblioNumber, 1 );
+    $biblioData->{reservecount} = 1;    # new reserve
+    foreach my $res (@{$reserves}) {
+        my $found = $res->{found};
+        if ( $found && $found eq 'W' ) {
+            $rank--;
+        }
+        else {
+            $biblioData->{reservecount}++;
         }
-        $rank++;
-        $biblioData->{rank} = $rank;
     }
+    $biblioData->{rank} = $rank + 1;
 }
 
 #
-- 
1.7.11.2.249.g31c7954



More information about the Koha-patches mailing list