Koha-clms/Koha/Exceptions
Julian Maurice 0f304c55e2 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>
(cherry picked from commit 2b58f4d89c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-10-24 20:27:34 -10:00
..
Acquisition Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Checkouts Bug 30275: (follow-up) Drop renewer_id constraint 2022-07-05 09:46:18 -03:00
Item Bug 33817: Enforce server-side 2023-07-18 10:26:13 +01:00
Patron Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Account.pm Bug 33176: Enforce bad values 2023-07-17 08:15:11 +01:00
ArticleRequest.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Auth.pm Bug 31378: Add Auth mojo plugin 2022-11-08 14:30:33 -03:00
Authentication.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Authorization.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
BackgroundJob.pm Bug 30360: Add helper methods to Koha::BackgroundJobs 2022-05-05 16:11:36 +01:00
Calendar.pm Bug 27249: Prevent infinite loop when searching for an open day 2023-10-24 20:27:34 -10:00
Checkin.pm Bug 32121: Show an alert when adding a checked out item to an item bundle 2023-03-27 12:50:02 +02:00
Checkout.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
CirculationRule.pm Bug 33028: (follow-up) Add POD to new Exception 2023-08-07 20:05:46 -10:00
ClubHold.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Config.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
CurbsidePickup.pm Bug 30650: Prevent pickup to be created on holiday 2022-07-29 15:00:51 -03:00
Elasticsearch.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Hold.pm Bug 31086: Throw an exception when a hold is stored with no branchcode 2022-07-22 14:19:17 -03:00
Ill.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Library.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
MarcOverlayRule.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Metadata.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Object.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Password.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Patron.pm Bug 33229: Clear patron reading history when privacy is set to never 2023-04-14 15:39:41 -03:00
Plugin.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Suggestion.pm Bug 32942: (QA follow-up) Moving Suggestion->STATUS check to Suggestion::store 2023-09-20 20:01:17 -10:00
SysPref.pm Bug 30007: Add Koha::Exceptions::SysPref 2022-03-01 22:47:47 -10:00
Token.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
TransferLimit.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
Virtualshelf.pm Bug 30057: Move virtualshelf-related exceptions to a separate library 2022-06-06 14:30:37 -03:00
XSLT.pm Bug 12758: (QA follow-up) Enhance POD 2022-11-09 09:58:56 -03:00