From 066996f6d3e9f5c584bd4e41dfc5e19cb8b03931 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 10 Oct 2014 20:53:50 +0200 Subject: [PATCH] Bug 11126: qa follow-up - 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(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index c4fe7c0..032e044 100644 --- a/C4/Reserves.pm +++ b/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); diff --git a/t/db_dependent/Holds/LocalHoldsPriority.t b/t/db_dependent/Holds/LocalHoldsPriority.t index 2e092b2..d46ba8b 100755 --- a/t/db_dependent/Holds/LocalHoldsPriority.t +++ b/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 ); -- 2.1.0