From abf19383ed3c1e594b75df4cdaf24d6505128a12 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 27 Mar 2018 19:31:36 +0000 Subject: [PATCH] Bug 19945: (follow-up) optimization and test correction The double call to CanItemBeReserved was pointless in the C4/Reserves.pm HoldItem, as CanBookBeReserved calls CanItemBeReserved and even returns that code. Additionally, the tests failed, because there were 5 tests not 4. TEST PLAN ---------- prove t/db_dependent/ILSDI_Services.t run koha qa test tools Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall Signed-off-by: Nick Clemens --- C4/ILSDI/Services.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 4b03330428..72789942e1 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -740,9 +740,8 @@ sub HoldItem { return { code => 'RecordNotFound' } if $$item{biblionumber} ne $biblio->biblionumber; # Check for item disponibility - my $canitembereserved = C4::Reserves::CanItemBeReserved( $borrowernumber, $itemnumber )->{status}; + # CanItemBeReserved codes are passed back too. my $canbookbereserved = C4::Reserves::CanBookBeReserved( $borrowernumber, $biblionumber )->{status}; - return { code => $canitembereserved } unless $canitembereserved eq 'OK'; return { code => $canbookbereserved } unless $canbookbereserved eq 'OK'; # Pickup branch management -- 2.39.5