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

(-)a/C4/SIP/ILS.pm (-3 lines)
Lines 347-355 sub cancel_hold { Link Here
347
    if (!$patron) {
347
    if (!$patron) {
348
		$trans->screen_msg("Invalid patron barcode.");
348
		$trans->screen_msg("Invalid patron barcode.");
349
		return $trans;
349
		return $trans;
350
    } elsif (defined($patron_pwd) && !$patron->check_password($patron_pwd)) {
351
		$trans->screen_msg('Invalid patron password.');
352
		return $trans;
353
    }
350
    }
354
351
355
    unless ($item = C4::SIP::ILS::Item->new($item_id || $title_id)) {
352
    unless ($item = C4::SIP::ILS::Item->new($item_id || $title_id)) {
(-)a/t/db_dependent/SIP/ILS.t (-3 / +3 lines)
Lines 72-78 is( $ils->test_cardnumber_compare( 'A1234', 'b1234' ), Link Here
72
    q{}, 'borrower bc test identifies difference' );
72
    q{}, 'borrower bc test identifies difference' );
73
73
74
subtest cancel_hold => sub {
74
subtest cancel_hold => sub {
75
    plan tests => 5;
75
    plan tests => 6;
76
76
77
    my $library = $builder->build_object ({ class => 'Koha::Libraries' });
77
    my $library = $builder->build_object ({ class => 'Koha::Libraries' });
78
    my $patron = $builder->build_object(
78
    my $patron = $builder->build_object(
Lines 117-124 subtest cancel_hold => sub { Link Here
117
117
118
    my $ils = C4::SIP::ILS->new({ id => $library->branchcode });
118
    my $ils = C4::SIP::ILS->new({ id => $library->branchcode });
119
    my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
119
    my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
120
    my $transaction = $ils->cancel_hold($patron->cardnumber,undef,$item->barcode,undef);
120
    my $transaction = $ils->cancel_hold($patron->cardnumber,"",$item->barcode,undef);
121
121
122
    isnt( $transaction->{screen_msg}, 'Invalid patron password.', "Empty password succeeds" );
122
    is( $transaction->{screen_msg},"Hold Cancelled.","We get a success message when hold cancelled");
123
    is( $transaction->{screen_msg},"Hold Cancelled.","We get a success message when hold cancelled");
123
124
124
    is( $item->biblio->holds->count(), 0, "Bib has 0 holds remaining");
125
    is( $item->biblio->holds->count(), 0, "Bib has 0 holds remaining");
125
- 

Return to bug 27600