[Bug 40095] New: It would be beneficial to send the page when calling intranet_js plugin hooks
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Bug ID: 40095 Summary: It would be beneficial to send the page when calling intranet_js plugin hooks Change sponsored?: --- Product: Koha Version: unspecified Hardware: PC OS: Linux Status: NEW Severity: enhancement Priority: P1 - high Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk We have the intranet_js plugin hook to allow adding javascript to all intranet pages.. it would be great to have the specific page the hook is called from get passed so we can optionally run code to generate and return the JS instead of returning it for all pages. -- You are receiving this mail because: You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 183380 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183380&action=edit Bug 40095: Add context to intranet_js plugin hook The get_plugins_intranet_js method now passes the current script name (controller) to plugins via a 'page' parameter, allowing plugins to determine which page/controller is being displayed. This will allow plugin authors to only return JS that's relevant to the current page when they wish to do so. Test plan: 1. Create a plugin with an intranet_js method that logs the received parameters 2. Navigate to different pages in the staff interface 3. Verify that the plugin receives the page parameter containing the script name 4. Confirm that the script name reflects the actual controller (e.g., '/cgi-bin/koha/admin/admin-home.pl' when on the admin home page) 5. Run the test: prove t/db_dependent/Koha/Template/Plugin/KohaPlugins.t 6. Verify that the new test passes, confirming plugins receive the page parameter -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chloe.zermatten@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Roman Dolny <roman.dolny@jezuici.pl> 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=40095 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183380|0 |1 is obsolete| | --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 183411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183411&action=edit Bug 40095: Add context to intranet_js plugin hook The get_plugins_intranet_js method now passes the current script name (controller) to plugins via a 'page' parameter, allowing plugins to determine which page/controller is being displayed. This will allow plugin authors to only return JS that's relevant to the current page when they wish to do so. Test plan: 1. Create a plugin with an intranet_js method that logs the received parameters 2. Navigate to different pages in the staff interface 3. Verify that the plugin receives the page parameter containing the script name 4. Confirm that the script name reflects the actual controller (e.g., '/cgi-bin/koha/admin/admin-home.pl' when on the admin home page) 5. Run the test: prove t/db_dependent/Koha/Template/Plugin/KohaPlugins.t 6. Verify that the new test passes, confirming plugins receive the page parameter Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183411|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 191050 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191050&action=edit Bug 40095: Add context to intranet_js plugin hook The get_plugins_intranet_js method now passes the current script name (controller) to plugins via a 'page' parameter, allowing plugins to determine which page/controller is being displayed. This will allow plugin authors to only return JS that's relevant to the current page when they wish to do so. Test plan: 1. Create a plugin with an intranet_js method that logs the received parameters 2. Navigate to different pages in the staff interface 3. Verify that the plugin receives the page parameter containing the script name 4. Confirm that the script name reflects the actual controller (e.g., '/cgi-bin/koha/admin/admin-home.pl' when on the admin home page) 5. Run the test: prove t/db_dependent/Koha/Template/Plugin/KohaPlugins.t 6. Verify that the new test passes, confirming plugins receive the page parameter Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Kyle M Hall (khall) <kyle@bywatersolutions.com> 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=40095 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed CC| |lucas@bywatersolutions.com --- Comment #4 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- please add release notes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |The get_plugins_intranet_js release notes| |method now passes the | |current script name | |(controller) to plugins via | |a 'page' parameter, | |allowing plugins to | |determine which | |page/controller is being | |displayed. | | | |This will allow plugin | |authors to only return JS | |that's relevant to the | |current page when they wish | |to do so. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.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=40095 --- Comment #5 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40095 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #6 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- This will not be backported to 25.11.x due to it being deemed an enhancement or a dependancy not being met -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org