@@ -, +, @@ --- Koha/Hold.pm | 10 ++++------ t/db_dependent/Hold.t | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -228,9 +228,9 @@ sub is_in_transit { Returns true if hold is a cancelable hold -Holds may be canceled if they not found, or -are found and waiting. A hold found but in -transit cannot be canceled. +Holds may be only canceled if they are found. + +This is used from the OPAC. =cut @@ -238,9 +238,7 @@ sub is_cancelable { my ($self) = @_; return 1 unless $self->is_found(); - return 0 if $self->is_in_transit(); - return 1 if $self->is_waiting(); - return 0; + return 0; # if ->is_in_transit or if ->is_waiting } =head3 is_at_destination --- a/t/db_dependent/Hold.t +++ a/t/db_dependent/Hold.t @@ -123,11 +123,11 @@ ok( !$hold->is_in_transit, 'The hold is not in transit' ); # Test method is_cancelable $hold->found(undef); -ok( $hold->is_cancelable(), "Unfound hold is cancelable" ); +is( $hold->is_cancelable, 1, "Unfound hold is cancelable" ); $hold->found('W'); -ok( $hold->is_cancelable, "Waiting hold is cancelable" ); +is( $hold->is_cancelable, 0, "Waiting hold is not cancelable" ); $hold->found('T'); -ok( !$hold->is_cancelable, "In transit hold is not cancelable" ); +is( $hold->is_cancelable, 0, "In transit hold is not cancelable" ); # Test method is_at_destination $hold->found(undef); --