[Koha-devel] Canceling reserves via opac

Alex Arnaud alex.arnaud at biblibre.com
Tue Nov 7 11:25:49 CET 2017


Hi Koha community

Just came across a weird thing about the way Koha handle the ability to 
cancel reserves via opac user account.

There is 2 steps:
   - Displaying of the "cancel" button. Which depends on 
Koha::Hold->is_cancelable method,
   - the cancellation itself, which depends on 
C4::Reserves::CanReserveBeCanceledFromOpac

The problem is that the 2 sub do not behave the same. Just see:

/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; //
//}/

/sub CanReserveBeCanceledFromOpac {//
//    my ($reserve_id, $borrowernumber) = @_;//
//
//    return unless $reserve_id and $borrowernumber;//
//    my $reserve = Koha::Holds->find($reserve_id);//
//
//    return 0 unless $reserve->borrowernumber == $borrowernumber;//
//*return 0 if ( $reserve->found eq 'W' ) or ( $reserve->found eq 'T' );*//
//
//    return 1;//
//
//}/

A concrete example is that if i want to cancel a waiting reserve, i can 
see the button, but it does nothing. I think this should be fixed, but 
which sub is the right one?

Regards

Alex
Biblibre


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20171107/bd8eb98e/attachment.html>


More information about the Koha-devel mailing list