[Koha-bugs] [Bug 27249] Using the calendar to 'close' a branch can create an infinite loop during renewals

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 18 12:18:23 CEST 2023


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

--- Comment #3 from Julian Maurice <julian.maurice at biblibre.com> ---
Created attachment 153585
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153585&action=edit
Bug 27249: Prevent infinite loop when searching for an open day

Calendars can be configured in a way that all days are closed.
The simplest way to do that is to configure a repeatable holiday for
every day of the week.
With such calendars, searching for an open day will literally take
forever.

This patch sets a hard limit on how many iterations are allowed before
giving up. This limit is set to the arbitrary value of 5000, which
should be large enough to be able to consider there is no open days if
we haven't found any with that many iterations, and small enough to
allow the loop to end quickly

Test plan:
1. Set system preference 'useDaysMode' to 'Use the calendar to push the
   due date to the next open day' ('Datedue'). Make sure the existing
   circulation rules do not conflict with that setting.
2. Browse to Tools ยป Calendar
3. Set every day of the week to "Holiday repeated every same day of the
   week"
4. Issue an item to a patron
5. Check the box and select 'Renew selected items'
6. The renewal should fail pretty quickly

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


More information about the Koha-bugs mailing list