[Bug 27249] New: Using the calendar to 'close' a branch can create an infinite loop during renewals
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Bug ID: 27249 Summary: Using the calendar to 'close' a branch can create an infinite loop during renewals Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When calculating due date using holidays we don't account for the case where everyday is a holiday until the end of time To recreate: 1 - Set OverdueNoticeCalendar to 'Use calendar' and useDaysMode to 'Use the calendar to push' 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 - Watch the spinner spin...and spin...and spin -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 mathieu saby <mathsabypro@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mathsabypro@gmail.com Priority|P5 - low |P2 Severity|normal |major --- Comment #1 from mathieu saby <mathsabypro@gmail.com> --- Still valid Our koha was **completely** unavailable this week for several hours due to this bug. The level of severity of this bug must be raised! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #2 from mathieu saby <mathsabypro@gmail.com> --- If the library is never open in the future, and usedaymode uses calendar to define the new due date, the correct behavior should be that Koha does not change the original due date. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |julian.maurice@biblibre.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #3 from Julian Maurice <julian.maurice@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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- For testers: Since bug 28653, the checkouts table is automatically refreshed after a renew/checkin, so you won't be able to see the error message (and from what I have seen, the error handling code is buggy anyway). I will open a new bug report for that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34302 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Julian Maurice from comment #4)
I will open a new bug report for that.
Bug 34302 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153585|0 |1 is obsolete| | --- Comment #6 from Sam Lau <samalau@gmail.com> --- Created attachment 153682 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153682&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 Signed-off-by: Sam Lau <samalau@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Status|Signed Off |Failed QA --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I don't understand, what about the issue? I am getting a 500 at step 4: Exception 'Koha::Exceptions::Calendar::NoOpenDays' thrown 'Unable to find an open day for library CPL' at /usr/share/perl5/Exception/Class/Base.pm line 88 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Maybe there are other sysprefs/circ rules that make Koha the calendar checks different when checking out or renewing an item... Without the patch, do you get the infinite loop when checking out the item ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Julian Maurice from comment #8)
Maybe there are other sysprefs/circ rules that make Koha the calendar checks different when checking out or renewing an item...
I am using the default values.
Without the patch, do you get the infinite loop when checking out the item ?
Yes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 154728 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154728&action=edit Bug 27249: Catch NoOpenDays exception while checking out an item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- The last patch fixes the issue mentioned in comment 7 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Using the calendar to |Using the calendar to |'close' a branch can create |'close' a library can |an infinite loop during |create an infinite loop |renewals |during renewals -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153682|0 |1 is obsolete| | --- Comment #12 from David Nind <david@davidnind.com> --- Created attachment 154920 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154920&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 Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154728|0 |1 is obsolete| | --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 154921 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154921&action=edit Bug 27249: Catch NoOpenDays exception while checking out an item Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #14 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. I'm not sure if I tested this correctly, but this is what I did: . Set 'useDaysMode' to 'Use the calendar to push the due date to the next open day' . In the calendar, for Monday to Sunday, chose 'Holiday repeated every same day of the week' and ticked 'Copy to all libraries' . Before the patch: Can't issue anything - does nothing (stays sitting on the page with the browser loading button/indicator in the tab going round) . After patch: message is 'No open days found while calculating the due date. Check the library calendar.' . Removed holiday for Saturday and Sunday - can then issue something. . For the renewing items (Patron record > Details > tick renew box then 'Renew or check in selected items') - screen refreshes, no renewal, don't see any messages or errors. 2. I've signed off anyway, as this definitely fixes the issue of it sitting on the page doing nothing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Status|Signed Off |Failed QA --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAIL Koha/Exceptions/Calendar.pm WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 1) WARN circ/circulation.pl WARN tidiness The file is less tidy than before (bad/messy lines before: 244, now: 253) OK valid FAIL t/db_dependent/Holidays.t FAIL forbidden patterns forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 292) forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 318) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #16 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 156786 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156786&action=edit Bug 27249: Fix code style -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #17 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 156787 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156787&action=edit Bug 27249: Add missing POD for Koha::Exceptions::Calendar -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #18 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 156788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156788&action=edit Bug 27249: Replace DateTime->now by dt_from_string -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154920|0 |1 is obsolete| | --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 157163 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157163&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 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154921|0 |1 is obsolete| | --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 157164 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157164&action=edit Bug 27249: Catch NoOpenDays exception while checking out an item Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156786|0 |1 is obsolete| | --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 157165 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157165&action=edit Bug 27249: Fix code style Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156787|0 |1 is obsolete| | --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 157166 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157166&action=edit Bug 27249: Add missing POD for Koha::Exceptions::Calendar Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156788|0 |1 is obsolete| | --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 157167 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157167&action=edit Bug 27249: Replace DateTime->now by dt_from_string Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #24 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.05 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #25 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.05 |23.11.00,23.05.05,22.11.12 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27249 --- Comment #26 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org