[Koha-bugs] [Bug 19431] Error when trying to checkout an unknown barcode

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 20 19:08:28 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19431

--- Comment #12 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Marcel de Rooy from comment #11)
> -    unless( $onsite_checkout and
> C4::Context->preference("OnSiteCheckoutsForce") ) {
> +    if ( $error->{UNKNOWN_BARCODE} or not $onsite_checkout or not
> C4::Context->preference("OnSiteCheckoutsForce") ) {
> 
> If CanBookBeIssued sets the UNKNOWN_BARCODE flag, it returns no DEBT
> question and no other impossible errors. But since there is one error, it
> will set $blocker to 1. 
> Just wondering if there are other errors that should trigger the blocker
> flag when doing onsite checkouts here. If CanBookBeIssued said No, when is
> an onsite checkout still possible?

I put the test there to avoid to copy paste the blocker=1 and the IMPOSSIBLE
flag. Do you have something better to suggest?

> -    if( !$blocker || $force_allow_issue ){
> +
> +    if( $item and ( !$blocker or $force_allow_issue ) ){
> 
> Since you raised the blocker flag in the unknown barcode case, you do not
> need to test for $item here. Note that item is found by barcode and
> CanBookBeIssued calls GetItem with barcode parameter.

Yes definitely, but this code is very confusing and I think explicitly tell we
need $item here makes sense (even if useless in a algorithm pov, in my opinion
it helps the read).

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list