View | Details | Raw Unified | Return to bug 28644
Collapse All | Expand All

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 523-529 sub CanReserveBeCanceledFromOpac { Link Here
523
    my ($reserve_id, $borrowernumber) = @_;
523
    my ($reserve_id, $borrowernumber) = @_;
524
524
525
    return unless $reserve_id and $borrowernumber;
525
    return unless $reserve_id and $borrowernumber;
526
    my $reserve = Koha::Holds->find($reserve_id);
526
    my $reserve = Koha::Holds->find($reserve_id) or return;
527
527
528
    return 0 unless $reserve->borrowernumber == $borrowernumber;
528
    return 0 unless $reserve->borrowernumber == $borrowernumber;
529
    return 0 if ( $reserve->found eq 'W' ) or ( $reserve->found eq 'T' );
529
    return 0 if ( $reserve->found eq 'W' ) or ( $reserve->found eq 'T' );
(-)a/t/db_dependent/Reserves.t (-2 / +3 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 63;
20
use Test::More tests => 64;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 485-490 $cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{$br Link Here
485
is($cancancel, 0, 'Reserve in transfer status cant be canceled');
485
is($cancancel, 0, 'Reserve in transfer status cant be canceled');
486
486
487
$dbh->do('DELETE FROM reserves', undef, ($bibnum));
487
$dbh->do('DELETE FROM reserves', undef, ($bibnum));
488
is( CanReserveBeCanceledFromOpac($canres->{resserve_id}, $requesters{$branch_1}), undef,
489
    'Cannot cancel a deleted hold' );
488
AddReserve($branch_1,  $requesters{$branch_1}, $item_bibnum,
490
AddReserve($branch_1,  $requesters{$branch_1}, $item_bibnum,
489
           $bibitems,  1, undef, $expdate, $notes,
491
           $bibitems,  1, undef, $expdate, $notes,
490
           'a title',      $checkitem, '');
492
           'a title',      $checkitem, '');
491
- 

Return to bug 28644