[Bug 25114] New: Remove duplicated logic from GetLoanLength()
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Bug ID: 25114 Summary: Remove duplicated logic from GetLoanLength() Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: lari.taskula@hypernova.fi QA Contact: testopia@bugs.koha-community.org Remove duplicated logic for searching circulation rules. -- 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=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff 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=25114 --- Comment #1 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 102766 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102766&action=edit Bug 25089: Remove duplicated logic from GetLoanLength() Remove duplicated logic for searching circulation rules. This can be replaced with get_effective_rules(). To test: 1. prove t/db_dependent/Circulation/GetHardDueDate.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102766|0 |1 is obsolete| | --- Comment #2 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 102767 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102767&action=edit Bug 25114: Add checkout_type to set_rules To test: 1. Execute the following command to run a bunch of tests grep -rl --color=never 'get_effective_rule(|set_rule(|set_rules(' \ | grep '^.*\.t$' | xargs prove 2. Test onboarding tool 2.1. Drop&create your database (take backups first if needed) 2.2. Navigate to web installer 2.3. Continue until you reach onboarding tool step where circulation rules are added. 2.4. Observe new drop down selection "Checkout type". 2.5. Select any checkout type and continue the onboarding process. 2.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lari.taskula@hypernova.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102767|0 |1 is obsolete| | --- Comment #3 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 102768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102768&action=edit Bug 25114: Remove duplicated logic from GetLoanLength() Remove duplicated logic for searching circulation rules. This can be replaced with get_effective_rules(). To test: 1. prove t/db_dependent/Circulation/GetHardDueDate.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25089 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25089 [Bug 25089] Add checkout_type to circulation rules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Joonas Kylmälä <joonas.kylmala@helsinki.fi> 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=25114 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102768|0 |1 is obsolete| | --- Comment #4 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 105785 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105785&action=edit Bug 25114: Remove duplicated logic from GetLoanLength() Remove duplicated logic for searching circulation rules. This can be replaced with get_effective_rules(). To test: 1. prove t/db_dependent/Circulation/GetHardDueDate.t Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105785|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 108349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108349&action=edit Bug 25114: Remove duplicated logic from GetLoanLength() Remove duplicated logic for searching circulation rules. This can be replaced with get_effective_rules(). To test: 1. prove t/db_dependent/Circulation/GetHardDueDate.t Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> 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=25114 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The change made me wonder if we should keep GetLoanLength at all. It's currently only used by CalcDueDate. Should we replace the call there and get rid of this method? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.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=25114 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored --- Comment #8 from Lari Taskula <lari.taskula@hypernova.fi> --- Forgot to mention this the commit text but this was sponsored by The National Library of Finland. (In reply to Katrin Fischer from comment #6)
The change made me wonder if we should keep GetLoanLength at all. It's currently only used by CalcDueDate.
Should we replace the call there and get rid of this method?
I agree and confirm it is only being used in C4::CalcDueDate(). These days one can easily Get Loan Length via Koha::CirculationRules->get_effective_rules(). Let's open a new Bug for it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26238 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26238 [Bug 26238] Remove C4::GetLoanLength() -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25114 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- enhancement will not be backported to 20.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org