[Koha-bugs] [Bug 29145] Allow patrons to have overdue items that would not result in debarment when removing overdue debarments

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 21 18:41:40 CEST 2023


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

--- Comment #62 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
This was ultimately not a bad rebase. The trouble came from bug 31095 removing
GetDebarments.

The only conflicts where in C4/Circulation.pm MarkIssueReturned in the last
paragraph:

        # Possibly remove any OVERDUES related debarment
        my $overdue_restrictions = $patron->restrictions->search( { type =>
'OVERDUES' } );
        if ( C4::Context->preference('AutoRemoveOverduesRestrictions') ne 'no'
&& $patron->is_debarred ) {
            my $remove_restrictions =
                C4::Context->preference('AutoRemoveOverduesRestrictions') eq
'when_no_overdue_causing_debarment'
                ? !$patron->has_restricting_overdues( { issue_branchcode =>
$issue_branchcode } )
                : !$patron->has_overdues;
            if ( $remove_restrictions && $overdue_restrictions->count ) {
                DelUniqueDebarment( { borrowernumber => $borrowernumber, type
=> 'OVERDUES' } );
            }
        }

Once I got it rebased, I rewrote the tests to use $patron->restrictions instead
of GetDebarments. Tests pass now again!

I fixed some "John Doe" commit authorships from Kyle - realizing that our
mailmap already resolves "John Doe" to Kyle automatically, which is a little
confusing when tig, git log and the QA test show different things. Should be
all nice now :)

And last but not least: I applied some perltidy to the files. I didn't get a
perfect result sticking to the changed paragraphs, but it's very close.

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


More information about the Koha-bugs mailing list