Summary: | It would be beneficial to send the page when calling intranet_js plugin hooks | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Plugin architecture | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | Signed Off --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P1 - high | CC: | chloe.zermatten, kyle |
Version: | unspecified | ||
Hardware: | PC | ||
OS: | Linux | ||
GIT URL: | https://github.com/openfifth/koha/tree/bug_40095 | Change sponsored?: | --- |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 40095: Add context to intranet_js plugin hook
Bug 40095: Add context to intranet_js plugin hook |
Description
Martin Renvoize (ashimema)
2025-06-09 10:42:40 UTC
Created attachment 183380 [details] [review] 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 Created attachment 183411 [details] [review] 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> |