From bda42f2ebfc5b041f37b64e38789b51fbd6e6502 Mon Sep 17 00:00:00 2001
From: Katrin Fischer <Katrin.Fischer.83@web.de>
Date: Thu, 8 Aug 2013 01:40:17 +0200
Subject: [PATCH] Bug 10663: Follow-up - Revert and use CheckReserves for
 CanBookBeRenewed

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

This is part of the revert.
---
 C4/Circulation.pm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index aee1dbd..c578213 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -2486,7 +2486,7 @@ sub CanBookBeRenewed {
 
     my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves( $itemnumber );
 
-    if ( defined $resfound ) {
+    if ( $resfound ) { # '' when no hold was found
         $renewokay = 0;
         $error = "on_reserve";
     }
-- 
1.7.9.5