[Koha-bugs] [Bug 31427] Automatic renewal errors should come before many other renewal errors

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 1 11:17:00 CET 2024


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

--- Comment #34 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Koha::Checkout

sub attempt_auto_renew {
    my ( $self, $params ) = @_;
    my $confirm = $params->{confirm} // 0;

    # CanBookBeRenewed returns 'auto_renew' when the renewal should be done by
this script
    my ( $ok, $error ) = C4::Circulation::CanBookBeRenewed( $self->patron,
$self, undef, 1 );

After this call the $ok result is not even checked?!
Could be 'fine' but does not look good in general.


Related observation, going out of scope. In the same routine:
        my $updated = 0;
        if ( !$self->auto_renew_error || $error ne $self->auto_renew_error ) {
            $updated = 1
                unless (
                $self->auto_renew_error
                && (   $self->auto_renew_error eq 'auto_renew_final' && $error
eq 'too_many'
                    || $self->auto_renew_error eq 'auto_unseen_final' && $error
eq 'too_unseen' )
                );
            $self->auto_renew_error($error)->store if $confirm;
        }
        return ( 0, $error, $updated );
This does not look good either. $updated is passed back but $confirm is not
checked?

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


More information about the Koha-bugs mailing list