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 <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Mark Tompsett 2018-03-27 19:31:36 +00:00 committed by Nick Clemens
parent ac840a8460
commit abf19383ed

View file

@ -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