Koha/svc
Julian Maurice 2b58f4d89c
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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-17 14:45:31 -03:00
..
cataloguing Bug 31682: Silence automatic linker warn 2022-10-11 10:41:23 -03:00
club Bug 25079: Add a 'edit' functionality to the Clubs tool in the staff interface 2023-06-23 11:00:49 -03:00
config Bug 34369: Require CSRF token for updating system preferences 2023-09-25 18:18:40 -03:00
letters Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
mana
members
records Bug 32631: Error when previewing record during batch record modification 2023-01-27 16:16:43 -03:00
virtualshelves
article_request
authentication
authorised_values
barcode Bug 34732: (QA follow-up): tidy up code 2023-09-19 16:34:23 -03:00
bib Bug 29697: Replace some missing occurrences 2022-07-25 09:30:30 -03:00
bib_framework
bib_profile
checkin
checkout_notes
checkouts Bug 33804: Use as_due_date to display due dates 2023-07-14 08:59:39 -03:00
convert_report Bug 34533: jsdiff library missing from guided reports page 2023-08-29 14:37:13 -03:00
cover_images
creator_batches
holds Bug 24860: Add hold's item group to holds table on circulation.pl and moremember.pl 2022-11-04 19:39:57 -03:00
import_bib Bug 15869: Change framework on overlay 2023-02-07 10:32:22 -03:00
localization
new_bib
problem_reports
recall
renew Bug 27249: Prevent infinite loop when searching for an open day 2023-10-17 14:45:31 -03:00
report
return_claims
split_callnumbers