Summary: | Add a warning in the circ rules page if a plugin overrides rules | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Plugin architecture | Assignee: | Raphael Straub <raphael.straub> |
Status: | Needs Signoff --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | clemens.tubach, michael.skarupianski, michaela.sieber, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 39405 | ||
Bug Blocks: | |||
Attachments: |
Bug 39540: Add a warning to the circulation rules page if CalcFine is overwritten.
Bug 39540: Add a warning to the circulation rules page if CalcFine is overwritten. Bug 39540: Add a warning to the circulation rules page if CalcFine is overwritten. Bug 39540: Add a warning to the circulation rules page if CalcFine is overwritten. |
Description
Tomás Cohen Arazi (tcohen)
2025-04-03 08:23:09 UTC
Created attachment 180487 [details] [review] Bug 39540: 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) The code is correct. But could you please just add the template variable inside the IF? It would make the code more concise and simpler to track to. The patch wouldn't need to change so many files for tidying the structure too. Something like: ```perl if ( C4::Context->config("enable_plugins") ) { $template->param( overwrite_calc_fine_plugins => [ Koha::Plugins->new->GetPlugins( { method => 'overwrite_calc_fine', } ) ]; } ``` Thanks! Created attachment 180503 [details] [review] Bug 39540: 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) (In reply to Tomás Cohen Arazi (tcohen) from comment #2) > The code is correct. But could you please just add the template variable > inside the IF? It would make the code more concise and simpler to track to. > The patch wouldn't need to change so many files for tidying the structure > too. Yes, this is better. The updated patch is attached. Created attachment 180513 [details] [review] Bug 39540: 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) Created attachment 180518 [details] [review] Bug 39540: 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) |