[Bug 37826] New: Templates that use the variable script_name should be called by scripts that set it
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Bug ID: 37826 Summary: Templates that use the variable script_name should be called by scripts that set it Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: phil@chetcolibrary.org QA Contact: testopia@bugs.koha-community.org We have templates that use the variable script_name for the path and filename of the script that called them, particularly as the action attribute of forms that call back to it. We have scripts that set the template->param script_name to their path and filename. What we don't have is a 1:1 match between templates and scripts, as the failure mode in bug 37797 comment 1 shows. If you set action="[% script_name %]" when it isn't defined, you get action="", which may work for years if every form submitted to that script is a POST, but once someone changes one to a get, action="" will POST to aqbudgetperiods.pl?op=delete_confirm&budget_period_id=2 and both the things in the POST body and also things in the query string will wind up being sent to the script. What I don't have is any good idea how to find templates using unset script_name, short of just brute force looking at every one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Templates that use the |Remove the use of the |variable script_name should |script_name variable where |be called by scripts that |it is unnecessary |set it | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 175271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175271&action=edit Bug 37826: Remove the use of the script_name variable where it is unnecessary Most of the places where a "script_name" variable used it is not strictly necessary. Because it is also used inconsistently, I think it's better to simply remove the use of the variable where it isn't strictly necessary. This patch removes creation of the template variable from several scripts and updates the corresponding template with the URL itself. To test, apply the patch and restart services. Test the following pages, including the various permutations where they are present, e.g. New, Edit, Delete. - Administration -> Cities and towns -> Search via the header search form - Administratoin -> Currencies and exchange rates -> Search via the header search form - Administration -> Desks - Administration -> Budgets - Administration -> Authority types - Administration -> Authority types -> MARC structure -> Subfields - Administration -> Classification configuration - Administration -> MARC bibliographic framework - Administration -> MARC bibliographic framework -> MARC structure -> Subfields - Administration -> Record matching rules - Administration -> OAI repositories - Administration -> Patron attribute types - Administration -> System preferences -> Local use - Administration -> Z39.50/SRU servers - Acquisitions -> Vendor -> Contracts - Acquisitions -> Vendor -> Basket -> Export as CSV - Acquisitions -> Vendor -> Basket -> Edit basket - Acquisitions -> Vendor -> Basket groups - Tools -> Import patrons - Tools -> Notices and slips Sponsored-by: Athens County Public Libraries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Phil Ringnalda <phil@chetcolibrary.org> 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=37826 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175271|0 |1 is obsolete| | --- Comment #2 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 175448 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175448&action=edit Bug 37826: Remove the use of the script_name variable where it is unnecessary Most of the places where a "script_name" variable used it is not strictly necessary. Because it is also used inconsistently, I think it's better to simply remove the use of the variable where it isn't strictly necessary. This patch removes creation of the template variable from several scripts and updates the corresponding template with the URL itself. To test, apply the patch and restart services. Test the following pages, including the various permutations where they are present, e.g. New, Edit, Delete. - Administration -> Cities and towns -> Search via the header search form - Administratoin -> Currencies and exchange rates -> Search via the header search form - Administration -> Desks - Administration -> Budgets - Administration -> Authority types - Administration -> Authority types -> MARC structure -> Subfields - Administration -> Classification configuration - Administration -> MARC bibliographic framework - Administration -> MARC bibliographic framework -> MARC structure -> Subfields - Administration -> Record matching rules - Administration -> OAI repositories - Administration -> Patron attribute types - Administration -> System preferences -> Local use - Administration -> Z39.50/SRU servers - Acquisitions -> Vendor -> Contracts - Acquisitions -> Vendor -> Basket -> Export as CSV - Acquisitions -> Vendor -> Basket -> Edit basket - Acquisitions -> Vendor -> Basket groups - Tools -> Import patrons - Tools -> Notices and slips Sponsored-by: Athens County Public Libraries Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- QA by RM. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 --- Comment #4 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=37826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement removes release notes| |the $script_name variable | |from several pages where it | |is unnecessary, and updates | |the corresponding template | |with the URL itself. (Most | |of the places where a | |$script_name variable was | |used was not strictly | |necessary. It was also used | |inconsistently.) CC| |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=37826 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00 |25.05.00,24.11.03 released in| | 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=37826 --- Comment #5 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 24.11.x for 24.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37826 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to stable |Needs documenting --- Comment #6 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x (or 23.XX) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org