[Bug 39405] New: New hook overwrite_calc_fine for graduated fines calculation
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Bug ID: 39405 Summary: New hook overwrite_calc_fine for graduated fines calculation Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: michaela.sieber@kit.edu QA Contact: testopia@bugs.koha-community.org This new hook allows to overwrite the koha standard calculation of fines. This can be useful if your library has a fine policy with graduated fines per overdue letter (very popular in german academic libraries) This hook is implemented in the CalcFine method which is defined in overdue.pm -- 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=39405 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored Text to go in the| |This new hook allows to release notes| |overwrite the koha standard | |calculation of fines. This | |can be useful if your | |library has a fine policy | |with graduated fines per | |overdue letter. CC| |clemens.tubach@kit.edu, | |jan.kissig@th-wildau.de, | |katrin.fischer@bsz-bw.de, | |raphael.straub@kit.edu -- 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=39405 --- Comment #1 from Raphael Straub <raphael.straub@kit.edu> --- Created attachment 179582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179582&action=edit Bug 39405: Add hook overwrite_calc_fine to override CalcFine in Overdues.pm This new hook allows to overwrite the koha standard calculation of fines. This can be useful if your library has a fine policy with graduated fines per overdue letter. To test: 1) Apply patch. 2) Run prove -v t/db_dependent/Circulation/CalcFine.t 3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t 4) Sign off. Sponsored-by: Karlsruhe Institute of Technology (KIT) -- 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=39405 Raphael Straub <raphael.straub@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|raphael.straub@kit.edu | Assignee|koha-bugs@lists.koha-commun |raphael.straub@kit.edu |ity.org | Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- 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=39405 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #2 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Please also document the new hook on the wiki and ask for a commit to the kitchen-sink-plugin on github. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Note: Ideally we should return the same structure than CalCFine (ie. an array, not an arrayref). But we cannot: Koha/Plugins.pm 80 sub call { 95 my $response = eval { $plugin->$method(@args) }; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- For discussion: The first parameter "item" is confusing, it's not a Koha::Item object. Maybe we should pass something that is not too tight to the current signature of CalcFine (so the plugin won't break when/if we change it). If you need item's info, then pass the item object (or the item's id?) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #5 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- there should be a check on the circulation rules definition page, if any installed plugin implement this hook. You could check if any plugin implement the hook by using this code (found in C4/Letters.pm) ---- if ( C4::Context->config("enable_plugins") ) { my @plugins = Koha::Plugins->new->GetPlugins( { method => 'before_send_messages', } ); ---- That could be in another dependent bug :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #6 from Clemens Tubach <clemens.tubach@kit.edu> --- (In reply to Jonathan Druart from comment #4)
For discussion: The first parameter "item" is confusing, it's not a Koha::Item object.
Maybe we should pass something that is not too tight to the current signature of CalcFine (so the plugin won't break when/if we change it).
If you need item's info, then pass the item object (or the item's id?)
I talked with Raphael and Paul. We will pass the itemnumber and get the Koha:item into the plugin. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Raphael Straub <raphael.straub@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179582|0 |1 is obsolete| | --- Comment #7 from Raphael Straub <raphael.straub@kit.edu> --- Created attachment 180095 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180095&action=edit Bug 39405: Add hook overwrite_calc_fine to override CalcFine in Overdues.pm This new hook allows to overwrite the koha standard calculation of fines. This can be useful if your library has a fine policy with graduated fines per overdue letter. To test: 1) Apply patch. 2) Run prove -v t/db_dependent/Circulation/CalcFine.t 3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t 4) Sign off. Sponsored-by: Karlsruhe Institute of Technology (KIT) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #8 from Raphael Straub <raphael.straub@kit.edu> --- (In reply to Clemens Tubach from comment #6)
We will pass the itemnumber and get the Koha:item into the plugin. A new patch that does this is attached.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #9 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180111&action=edit Bug 39405: (follow-up) Simplify code for choosing the first fine values This patch avoids the introduction of a `foreach` loop and a `return` call inside of it, by using grep on the array assignment, and then just returning the first element on it, if any. No behavior change is expected. The code becomes easier to read and spot what is doing. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Needs Signoff |Failed QA --- Comment #10 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Hi Ralph. Good job here. A couple QA remarks: - In the tests file you introduce, you correctly add a subtest that wraps all actions inside a DB transaction. [GOOD] - Even though you wrap the subtest inside a transaction, some data is generated OUTSIDE the transaction i.e. `$branch` and `$category`. Those two should be generated inside the subtest and within the transaction. Otherwise running the test pollutes the DB [BLOCKER] - The hook is added to Koha::Plugin::Test [GOOD] - The fact that your code skips 'undefined result' plugin hook calls is not tested [BLOCKER] - The fact your code will pick the first available value is not tested [BLOCKER] I will submit a patch now, creating two new sample plugins you can use for writing those tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #11 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180127 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180127&action=edit Bug 39405: Add more plugin examples to build tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #12 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #10)
I will submit a patch now, creating two new sample plugins you can use for writing those tests.
Added 3 plugins, actually. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #13 from Raphael Straub <raphael.straub@kit.edu> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #10)
- The fact that your code skips 'undefined result' plugin hook calls is not tested [BLOCKER] - The fact your code will pick the first available value is not tested [BLOCKER]
I think, we cannot test these two facts as long as Koha::Plugins->call() calls the plugin hooks and returns the results in an arbitrary order. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.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=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180095|0 |1 is obsolete| | Attachment #180111|0 |1 is obsolete| | Attachment #180127|0 |1 is obsolete| | --- Comment #14 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180342 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180342&action=edit Bug 39405: Add hook overwrite_calc_fine to override CalcFine in Overdues.pm This new hook allows to overwrite the koha standard calculation of fines. This can be useful if your library has a fine policy with graduated fines per overdue letter. To test: 1) Apply patch. 2) Run prove -v t/db_dependent/Circulation/CalcFine.t 3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t 4) Sign off. Sponsored-by: Karlsruhe Institute of Technology (KIT) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #15 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180343 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180343&action=edit Bug 39405: (follow-up) Simplify code for choosing the first fine values This patch avoids the introduction of a `foreach` loop and a `return` call inside of it, by using grep on the array assignment, and then just returning the first element on it, if any. No behavior change is expected. The code becomes easier to read and spot what is doing. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #16 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180344&action=edit Bug 39405: Add more plugin examples to build tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #17 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- I added the requested tests aiming to help this patchset make it to the crossing line. I still think, as discussed in person at Marseille, that some warning should be displayed on the circulation page when a plugin overrides rules. As Arthur pointed out, it is not a terribly hard thing to do. I leave it to the QA person to decide if it should be done here or in a separate bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|New hook |Add plugin hook |overwrite_calc_fine for |`overwrite_calc_fine` to |graduated fines calculation |override fine calculation -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This new hook allows to |This new hook allows to release notes|overwrite the koha standard |overwrite the internal Koha |calculation of fines. This |standard calculation of |can be useful if your |fines. This can be useful |library has a fine policy |if your library needs to |with graduated fines per |implement its own |overdue letter. |algorithm. For example, if | |it has a fine policy with | |graduated fines per overdue | |letter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Architecture, internals, |Plugin architecture |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #18 from Raphael Straub <raphael.straub@kit.edu> --- Created attachment 180433 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180433&action=edit Bug 39405: (follow-up) Add the parameter borrowernumber to the overwrite_calc_fine plugin hook This patch adds the borrowernumber as a parameter to the overwrite_calc_fine plugin hook. E.g., the borrower is needed for calculating graduated fines. Sponsored-by: Karlsruhe Institute of Technology (KIT) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Raphael Straub <raphael.straub@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #19 from Raphael Straub <raphael.straub@kit.edu> --- I added another patch to add the borrowernumber as a parameter to the plugin hook. We need the borrowernumber to implement graduated fines. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #20 from Raphael Straub <raphael.straub@kit.edu> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #17)
I added the requested tests aiming to help this patchset make it to the crossing line. Thanks.
I still think, as discussed in person at Marseille, that some warning should be displayed on the circulation page when a plugin overrides rules.
As Arthur pointed out, it is not a terribly hard thing to do. I'll look into it.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Tomás Cohen Arazi (tcohen) <tomascohen@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=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180342|0 |1 is obsolete| | Attachment #180343|0 |1 is obsolete| | Attachment #180344|0 |1 is obsolete| | Attachment #180433|0 |1 is obsolete| | --- Comment #21 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180439 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180439&action=edit Bug 39405: Add hook overwrite_calc_fine to override CalcFine in Overdues.pm This new hook allows to overwrite the koha standard calculation of fines. This can be useful if your library has a fine policy with graduated fines per overdue letter. To test: 1) Apply patch. 2) Run prove -v t/db_dependent/Circulation/CalcFine.t 3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t 4) Sign off. Sponsored-by: Karlsruhe Institute of Technology (KIT) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #22 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180440 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180440&action=edit Bug 39405: (follow-up) Simplify code for choosing the first fine values This patch avoids the introduction of a `foreach` loop and a `return` call inside of it, by using grep on the array assignment, and then just returning the first element on it, if any. No behavior change is expected. The code becomes easier to read and spot what is doing. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #23 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180441 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180441&action=edit Bug 39405: Add more plugin examples to build tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #24 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 180442 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180442&action=edit Bug 39405: (follow-up) Add the parameter borrowernumber to the overwrite_calc_fine plugin hook This patch adds the borrowernumber as a parameter to the overwrite_calc_fine plugin hook. E.g., the borrower is needed for calculating graduated fines. Sponsored-by: Karlsruhe Institute of Technology (KIT) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39540 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39540 [Bug 39540] Add a warning in the circ rules page if a plugin overrides rules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #25 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Raphael Straub from comment #20)
I still think, as discussed in person at Marseille, that some warning should be displayed on the circulation page when a plugin overrides rules.
As Arthur pointed out, it is not a terribly hard thing to do. I'll look into it.
I filed bug 39540 for this. Lets discuss it there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #26 from Raphael Straub <raphael.straub@kit.edu> --- Created attachment 180486 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180486&action=edit Bug 39405: Add a warning to the circulation rules page if CalcFine is overwritten. This patch adds a warning to the "Circulation and fine rules" page in "Koha administration" if there is an enabled plugin that implements the overwrite_calc_fine plugin hook. To test: 1) Apply the patch. 2) In your browser go to /cgi-bin/koha/admin/smart-rules.pl and check that there is no warning on the top of the page. 3) Install a plugin that implements overwrite_calc_fine. 4) Reload /cgi-bin/koha/admin/smart-rules.pl and check that now there is a warning that displays the installed plugin's name. Sponsored-by: Karlsruhe Institute of Technology (KIT) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #27 from Raphael Straub <raphael.straub@kit.edu> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #25)
I filed bug 39540 for this. Lets discuss it there.
I accidentally attached the patch here before I saw the new bug. Is there a way to delete the patch in this bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180486|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #28 from Michaela Sieber <michaela.sieber@kit.edu> --- (In reply to Raphael Straub from comment #27)
(In reply to Tomás Cohen Arazi (tcohen) from comment #25)
I filed bug 39540 for this. Lets discuss it there.
I accidentally attached the patch here before I saw the new bug. Is there a way to delete the patch in this bug?
I marked it as obsolete so you can upload the patch to Bug 39540 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180439|0 |1 is obsolete| | --- Comment #29 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 180505 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180505&action=edit Bug 39405: Add hook overwrite_calc_fine to override CalcFine in Overdues.pm This new hook allows to overwrite the koha standard calculation of fines. This can be useful if your library has a fine policy with graduated fines per overdue letter. To test: 1) Apply patch. 2) Run prove -v t/db_dependent/Circulation/CalcFine.t 3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t 4) Sign off. Sponsored-by: Karlsruhe Institute of Technology (KIT) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180440|0 |1 is obsolete| | --- Comment #30 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 180506 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180506&action=edit Bug 39405: (follow-up) Simplify code for choosing the first fine values This patch avoids the introduction of a `foreach` loop and a `return` call inside of it, by using grep on the array assignment, and then just returning the first element on it, if any. No behavior change is expected. The code becomes easier to read and spot what is doing. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180441|0 |1 is obsolete| | --- Comment #31 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 180507 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180507&action=edit Bug 39405: Add more plugin examples to build tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180442|0 |1 is obsolete| | --- Comment #32 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 180508 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180508&action=edit Bug 39405: (follow-up) Add the parameter borrowernumber to the overwrite_calc_fine plugin hook This patch adds the borrowernumber as a parameter to the overwrite_calc_fine plugin hook. E.g., the borrower is needed for calculating graduated fines. Sponsored-by: Karlsruhe Institute of Technology (KIT) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #33 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- The perfectionist in me would love to adjust the parameters we pass to the plugin here.. I'd love to see a Koha::Checkout object passed which could then easily be used to fetch cached patron, item etc etc information. However.. the pragmatist in me knows that's out of scope and would mean adding either unrequited DB hits within CalcFine itself or reworking the callers to pass this information instead of passing plain hashes and strings. So.. with that in mind I'm going to PQA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #34 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks for all the work and help with this one! 1) Please remember to update wiki 2) Not sure yet if this will break tests now, but I believe it might need fixing after bug 39367: FAIL t/lib/plugins/Koha/Plugin/1_CalcFineEmpty.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 FAIL t/lib/plugins/Koha/Plugin/2_CalcFineNotEmpty.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 FAIL t/lib/plugins/Koha/Plugin/3_CalcFineBadValue.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 --- Comment #35 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_24_11_candidate --- Comment #36 from Michaela Sieber <michaela.sieber@kit.edu> --- Could this please be backported? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_11_candidate | Version(s)|25.05.00 |25.05.00,24.11.04 released in| | --- Comment #37 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 24.11.x for 24.11.04 (v24.11.04-2) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39405 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #38 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org