[Bug 42298] New: "No automatic renewal before" falls back to "No renewal before" if former is greater than the latter
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42298 Bug ID: 42298 Summary: "No automatic renewal before" falls back to "No renewal before" if former is greater than the latter Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: lari.taskula@hypernova.fi QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Although this discovery was made due to a misconfiguration (we actually meant "no automatic renewals before" to have a value smaller than "no renewal before"), I think this finding is still worth reporting. --- Koha has two circulation rules for setting the earliest date a checkout can be renewed: "No renewal before" for manual renewals, and "No automatic renewal before" for automatic renewals. Using automatic renewals, we discovered that if circulation rule "No automatic renewal before" has a value greater than "No renewal before", automatic renewals are actually performed according to the "No renewal before" (manual) rule. Furthermore, this causes another bug where "too_soon" gets written in issues.auto_renew_error, instead of "auto_too_soon" as should be expected when called from the automatic_renewals.pl cronjob. This incorrect error status then causes yet another issue in AUTO_RENEWAL_DGST notices. The default notice template skips autorenewals with "auto_too_soon" error status, but since this bug writes it as "too_soon", the error is unhandled and such failed autorenewals unexpectedly become included in the notice. -- 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=42298 --- Comment #1 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 196825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196825&action=edit Bug 42298: Add a failing test To test: 1. prove t/db_dependent/Circulation.t 2. Observe the following failures t/db_dependent/Circulation.t .. 17/87 # Failed test 'Bug 25393: Can auto renew' # at t/db_dependent/Circulation.t line 1127. # got: '0' # expected: '1' # Failed test 'Bug 25393: Can auto renew' # at t/db_dependent/Circulation.t line 1128. # got: 'too_soon' # expected: 'auto_renew' # Failed test 'soonest_renew_date is not returned because this issue can be renewed' # at t/db_dependent/Circulation.t line 1129. # got: '2026-04-07T23:59:00' # expected: undef # Failed test 'No renewal before is 99, patron opted out of auto_renewal so can renew' # at t/db_dependent/Circulation.t line 1134. # got: '0' # expected: '1' # Looks like you failed 4 tests of 121. -- 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=42298 --- Comment #2 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 196826 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196826&action=edit Bug 42298: Add a failing test To test: 1. prove t/db_dependent/Circulation.t 2. Observe the following failures t/db_dependent/Circulation.t .. 17/87 # Failed test 'Bug 25393: Can auto renew' # at t/db_dependent/Circulation.t line 1127. # got: '0' # expected: '1' # Failed test 'Bug 25393: Can auto renew' # at t/db_dependent/Circulation.t line 1128. # got: 'too_soon' # expected: 'auto_renew' # Failed test 'soonest_renew_date is not returned because this issue can be renewed' # at t/db_dependent/Circulation.t line 1129. # got: '2026-04-07T23:59:00' # expected: undef # Failed test 'No renewal before is 99, patron opted out of auto_renewal so can renew' # at t/db_dependent/Circulation.t line 1134. # got: '0' # expected: '1' # Looks like you failed 4 tests of 121. -- 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=42298 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196825|0 |1 is obsolete| | -- 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=42298 --- Comment #3 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 196906 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196906&action=edit Bug 42298: Add a failing test To test: 1. prove t/db_dependent/Circulation.t 2. Observe the following failures t/db_dependent/Circulation.t .. 17/87 # Failed test 'Bug 42298: No autorenew before rule is respected' # at t/db_dependent/Circulation.t line 1134. # got: '0' # expected: '1' # Failed test 'Bug 42298: No autorenew before rule is respected' # at t/db_dependent/Circulation.t line 1135. # got: 'too_soon' # expected: 'auto_renew' # Failed test 'soonest_renew_date is not returned because this issue can be renewed' # at t/db_dependent/Circulation.t line 1136. # got: '2026-04-21T23:59:00' # expected: undef # Failed test 'No renewal before is 99, patron opted out of auto_renewal so can renew' # at t/db_dependent/Circulation.t line 1141. # got: '0' # expected: '1' # Looks like you failed 4 tests of 124. -- 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=42298 --- Comment #4 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 196907 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196907&action=edit Bug 42298: Automatic renewals should only respect the "No automatic renewals before" rule To test: 1. prove t/db_dependent/Circulation.t 2. Observe success -- 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=42298 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=42298 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196826|0 |1 is obsolete| | -- 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=42298 --- Comment #5 from Lari Taskula <lari.taskula@hypernova.fi> --- (In reply to Lari Taskula from comment #4)
Created attachment 196907 [details] [review] Bug 42298: Automatic renewals should only respect the "No automatic renewals before" rule
Note, this patch removes the fallback functionality where "No renewals before" is also checked for automatic renewals, if renewal would otherwise be allowed by "No automatic renewals before". In other words, when running automatic_renewals.pl cronjob, before this patch Koha would first check if an automatic renewal would be allowed by "No automatic renewals before". If allowed, it would then proceed to also check "No renewals before" rule and possibly reject the automatic renewal. Whether this functionality is a feature or a bug, is unknown to me. I'm more inclined to view it as a bug because having a distinct "no renewal before" rule for automatic renewals sounds like it should be the one to be respected. -- 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=42298 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=42298 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196906|0 |1 is obsolete| | -- 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=42298 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196907|0 |1 is obsolete| | -- 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=42298 --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 197115 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197115&action=edit Bug 42298: Add a failing test To test: 1. prove t/db_dependent/Circulation.t 2. Observe the following failures t/db_dependent/Circulation.t .. 17/87 # Failed test 'Bug 42298: No autorenew before rule is respected' # at t/db_dependent/Circulation.t line 1134. # got: '0' # expected: '1' # Failed test 'Bug 42298: No autorenew before rule is respected' # at t/db_dependent/Circulation.t line 1135. # got: 'too_soon' # expected: 'auto_renew' # Failed test 'soonest_renew_date is not returned because this issue can be renewed' # at t/db_dependent/Circulation.t line 1136. # got: '2026-04-21T23:59:00' # expected: undef # Failed test 'No renewal before is 99, patron opted out of auto_renewal so can renew' # at t/db_dependent/Circulation.t line 1141. # got: '0' # expected: '1' # Looks like you failed 4 tests of 124. Signed-off-by: David Nind <david@davidnind.com> -- 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=42298 --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 197116 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197116&action=edit Bug 42298: Automatic renewals should only respect the "No automatic renewals before" rule To test: 1. prove t/db_dependent/Circulation.t 2. Observe success Signed-off-by: David Nind <david@davidnind.com> -- 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=42298 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |lari.taskula@hypernova.fi |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org