https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44283 Bug ID: 44283 Summary: AddUniqueDebarment gives an indefinite restriction an end date, and cannot make a dated one indefinite Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- AddUniqueDebarment (Koha/Patron/Debarments.pm) is meant not to shorten an existing restriction of the same type ("We don't want to shorten a unique debarment's period"), but it only compares when both have a date: $params->{'expiration'} = $debarment->expiration if ( $debarment->expiration && $debarment->expiration gt $params->{'expiration'} ); - The existing restriction is indefinite, the new call has a date: the date is written, so the indefinite restriction now ends on that date. - The existing restriction has a date, the new call has none (indefinite): the old date is kept, so the restriction is not extended. It is used by debar_patrons_with_fines.pl (FINES), overdue_notices.pl (OVERDUES) and returns (SUSPENSION). To reproduce (main): 1. A patron who owes 50.00. 2. perl misc/cronjobs/debar_patrons_with_fines.pl -a 40 -m 'Fines over 40' -c The patron has a FINES restriction with no end date. 3. perl misc/cronjobs/debar_patrons_with_fines.pl -a 40 -m 'Fines over 40' -e 2026-12-31 -c The FINES restriction now expires on 2026-12-31: after that date the patron can borrow again while still owing 50.00. Expected: an indefinite restriction stays indefinite, and a call with no expiration makes the restriction indefinite. t/db_dependent/Patron/Borrower_Debarments.t currently asserts the first case ("AddUniqueDebarment updated the OVERDUES restriction correctly" after giving an indefinite OVERDUES restriction a date); the patch changes that assertion. Reproduced on main (c8e8025). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.