[Bug 42534] New: wrapper-staff-tool-plugin.inc interferes with js and includes in template files
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42534 Bug ID: 42534 Summary: wrapper-staff-tool-plugin.inc interferes with js and includes in template files Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: lisette@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Wrapper changes in Bug 42163 to support the vue changes made in Bug 41367 means you can't use a separate [% MACRO jsincludes BLOCK %] in plugins. Additionally if you're using any includes (such as datatables.inc) they no longer load because the wrapper [% MACRO jsincludes BLOCK %] overrides any inline [% MACRO jsincludes BLOCK %] You can use [% INCLUDE datatables.inc %] outside the wrapper, but most examples have it inside and I fear plugins using the wrapper will break on an update to 26.05. You can also put your <script> after the wrapper for loading it. We could try and make changes to the plugin structure/wrapper to make this work a little smoother. We could add common includes like datatable, calendar, select2, etc into the wrapper, but that seems like a long term maintenance issue. Another way could be to undo the vue change/figure out another way to load the admin menu or otherwise contain it so it's not overriding in page [% MACRO jsincludes BLOCK %] This would be the least disruptive for existing plugins, so is probably the way to go, but I'm not sure there's a good way to handle this. I'm very open to ideas about how to best handle this. -- 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=42534 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42163, 41367 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41367 [Bug 41367] Staff user interface - no sidebar menu when on record sources pages https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42163 [Bug 42163] wrapper-staff-tool-plugin.inc no longer loads the admin menu -- 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=42534 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com, | |martin.renvoize@openfifth.c | |o.uk, | |nick@bywatersolutions.com, | |pedro.amorim@openfifth.co.u | |k, tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42534 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@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=42534 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Yeah, that was the concern I had back on comments like https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42163#c6 I think the best bet is going to be create a new mechanism and adapt koha-tmpl/intranet-tmpl/prog/en/includes/wrapper-staff-tool-plugin.inc and intranet-bottom.inc to using it I'll try a really quick little proof of concept... -- 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=42534 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Hmmm actually it looks like [% MACRO jsincludes BLOCK %] in koha-tmpl/intranet-tmpl/prog/en/includes/wrapper-staff-tool-plugin.inc isn't actually doing anything. I think it's because the MACRO is scoped within the wrapper. Let's see... -- 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=42534 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Ah wait I see it now. Too easy. -- 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=42534 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- 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=42534 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Created attachment 198656 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198656&action=edit Bug 42534: Add global mechanism for adding Javascript snippets to staff interface footers This change adds a global mechanism where any template (regardless of its place in the WRAPPER/INCLUDE structure) can add Javascript to the footer of the webpage. Technically, it could be used for any HTML content, but we're assuming it's Javascript here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42534 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- So the patch I've attached is an idea I've had for a while. The idea being that any template wrapper/include could inject Javascript into the page footer. It's probably worth mentioning that it relies on the Template::Toolkit being evaluated at define time rather than call time. I think that should be OK in most cases. -- As for koha-tmpl/intranet-tmpl/prog/en/includes/wrapper-staff-tool-plugin.inc more specifically... I don't think it actually needs admin-menu.js because the wrapper will never match any of the paths in it. And it doesn't need the island stuff because main-container.inc takes care of that. So another option is to just take it all out. I thought I'd use this as an opportunity to showcase this idea of pushing output chunks into an array and then printing them out in the page footer. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org