<div dir="ltr">Alex,<div><br></div><div>A borrower should not be allowed to cancel a waiting hold; that would leave items orphaned on the holds shelf.</div><div><br></div><div>Cancelling waiting holds was removed from the OPAC, but the button was not.  See discussion in</div><div><br></div><div><a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18856">https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18856</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 7, 2017 at 5:25 AM, Alex Arnaud <span dir="ltr"><<a href="mailto:alex.arnaud@biblibre.com" target="_blank">alex.arnaud@biblibre.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Koha community<br>
    <br>
    Just came across a weird thing about the way Koha handle the ability
    to cancel reserves via opac user account.<br>
    <br>
    There is 2 steps:<br>
      - Displaying of the "cancel" button. Which depends on
    Koha::Hold->is_cancelable method,<br>
      - the cancellation itself, which depends on
    C4::Reserves::<wbr>CanReserveBeCanceledFromOpac<br>
    <br>
    The problem is that the 2 sub do not behave the same. Just see:<br>
    <br>
    <font size="-1"><i>sub is_cancelable {</i><i><br>
      </i><i>    my ($self) =
        @_;                           <wbr>                              <wbr>      
      </i><i><br>
      </i><i>    </i><i><br>
      </i><i>    <b>return 1 unless $self->is_found();</b></i><i><br>
      </i><i>    return 0 if
        $self->is_in_transit();       <wbr>                              <wbr>       
      </i><i><br>
      </i><i>    <b>return 1 if $self->is_waiting(); </b>         <wbr>                              <wbr>       
      </i><i><br>
      </i><i>    return
        0;                            <wbr>                              <wbr>            
      </i><i><br>
      </i><i>}</i></font><br>
    <br>
    <font size="-1"><i>sub CanReserveBeCanceledFromOpac {</i><i><br>
      </i><i>    my ($reserve_id, $borrowernumber) = @_;</i><i><br>
      </i><i><br>
      </i><i>    return unless $reserve_id and $borrowernumber;</i><i><br>
      </i><i>    my $reserve = Koha::Holds->find($reserve_id)<wbr>;</i><i><br>
      </i><i><br>
      </i><i>    return 0 unless $reserve->borrowernumber ==
        $borrowernumber;</i><i><br>
      </i><i>    <b>return 0 if ( $reserve->found eq 'W' ) or (
          $reserve->found eq 'T' );</b></i><i><br>
      </i><i><br>
      </i><i>    return 1;</i><i><br>
      </i><i><br>
      </i><i>}</i></font><br>
    <br>
    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?<br>
    <br>
    Regards<br>
    <br>
    Alex<br>
    Biblibre<br>
    <br>
    <br>
  </div>

<br>______________________________<wbr>_________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org">Koha-devel@lists.koha-<wbr>community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.<wbr>org/cgi-bin/mailman/listinfo/<wbr>koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.<wbr>org/</a><br></blockquote></div><br></div>