Browse Source

Bug 11126: qa follow-up

- use Modern::Perl;
- fix a typo
- remove an old comment

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
3.18.x
Jonathan Druart 8 years ago
committed by Tomas Cohen Arazi
parent
commit
659f7cd097
  1. 5
      C4/Reserves.pm
  2. 5
      t/db_dependent/Holds/LocalHoldsPriority.t

5
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);

5
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 );

Loading…
Cancel
Save