@@ -, +, @@ - use Modern::Perl; - fix a typo - remove an old comment --- C4/Reserves.pm | 5 +---- t/db_dependent/Holds/LocalHoldsPriority.t | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -976,13 +976,10 @@ sub CheckReserves { if ( $res->{'itemnumber'} == $itemnumber && $res->{'priority'} == 0) { return ( "Waiting", $res, \@reserves ); # Found it } else { - # Lazy fetch for borrower and item. We only need to know about the patron and item - # each and every time if we are using LocalHoldsPriority. This is a great place to - # leverage the inherent lazy fetching of DBIx::Class. my $borrowerinfo; my $iteminfo; - my $local_hold_match; + if ($LocalHoldsPriority) { $borrowerinfo = C4::Members::GetMember( borrowernumber => $res->{'borrowernumber'} ); $iteminfo = C4::Items::GetItem($itemnumber); --- a/t/db_dependent/Holds/LocalHoldsPriority.t +++ a/t/db_dependent/Holds/LocalHoldsPriority.t @@ -1,7 +1,6 @@ #!/usr/bin/perl -use strict; -use warnings; +use Modern::Perl; use t::lib::Mocks; use C4::Context; @@ -83,7 +82,7 @@ my ($status, $reserve, $all_reserves); t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 0 ); ($status, $reserve, $all_reserves) = CheckReserves($itemnumber); -ok( $reserve->{borrowernumber} eq $borrowernumbers[0], "Recieved expected results with LocalHoldsPriority disabled" ); +ok( $reserve->{borrowernumber} eq $borrowernumbers[0], "Received expected results with LocalHoldsPriority disabled" ); t::lib::Mocks::mock_preference( 'LocalHoldsPriority', 1 ); --