Bug 10663: restore ability of active hold requests to block renewal
authorTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 5 Aug 2013 18:23:44 +0000 (15:23 -0300)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 15 Aug 2013 22:31:52 +0000 (22:31 +0000)
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This reverts changes made to CanBookBeRenewed by
patches from bug 9367.
GetReserveStatus is not suitable to recognize if an item
can fild a hold on return and CheckReserves is restored.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
This patch includes a squash of a follow-up authored by
Katrin Fischer <Katrin.Fischer.83@web.de>:

  CheckReserves returns '' when no reserve is found,
  so $resfound will always be defined and we need to
  check if it's true.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Circulation.pm

index ca66931..c578213 100644 (file)
@@ -2484,8 +2484,9 @@ sub CanBookBeRenewed {
         $error = "too_many";
     }
 
-    my $resstatus = C4::Reserves::GetReserveStatus($itemnumber);
-    if ( $resstatus eq "Waiting" or $resstatus eq "Reserved" ) {
+    my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves( $itemnumber );
+
+    if ( $resfound ) { # '' when no hold was found
         $renewokay = 0;
         $error = "on_reserve";
     }