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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 602-608 sub CanReserveBeCanceledFromOpac { Link Here
602
    my ($reserve_id, $borrowernumber) = @_;
602
    my ($reserve_id, $borrowernumber) = @_;
603
603
604
    return unless $reserve_id and $borrowernumber;
604
    return unless $reserve_id and $borrowernumber;
605
    my $reserve = Koha::Holds->find($reserve_id);
605
    my $reserve = Koha::Holds->find($reserve_id) or return;
606
606
607
    return 0 unless $reserve->borrowernumber == $borrowernumber;
607
    return 0 unless $reserve->borrowernumber == $borrowernumber;
608
    return $reserve->is_cancelable_from_opac;
608
    return $reserve->is_cancelable_from_opac;
(-)a/t/db_dependent/Reserves.t (-2 / +4 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 67;
20
use Test::More tests => 68;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 555-560 $cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{$br Link Here
555
is($cancancel, 0, 'Reserve in transfer status cant be canceled');
555
is($cancancel, 0, 'Reserve in transfer status cant be canceled');
556
556
557
$dbh->do('DELETE FROM reserves', undef, ($bibnum));
557
$dbh->do('DELETE FROM reserves', undef, ($bibnum));
558
is( CanReserveBeCanceledFromOpac($canres->{resserve_id}, $requesters{$branch_1}), undef,
559
    'Cannot cancel a deleted hold' );
560
558
AddReserve(
561
AddReserve(
559
    {
562
    {
560
        branchcode     => $branch_1,
563
        branchcode     => $branch_1,
561
- 

Return to bug 28644