https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38723 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize (ashimema) from comment #3)
This doesn't work.. LOAD_PLUGINS doesn't work as I thought at all.. but I'm a bit confused as to how to resolve it right now.
So I've got a couple ideas. 1. Try to use PRE_PROCESS to pre process a template containing the variables we need 2. Creating a Template::Plugins provider for LOAD_PLUGINS and a Template::Filters provider for LOAD_FILTERS and then loading them via whatever necessary methods. I don't think Jonathan is on the right track with "POC LOAD_FILTERS for raw". Check out bug 41279 for an example of what I mean of creating a new provider to hand to the Template object. 3. For "Koha" and "Asset", [% USE Koha %] and [% USE Asset %] aren't just loading the plugins they're also returning objects with those variable names. In theory, we could just pass them into the Template object using the VARIABLES config option. (That said, it looks like VARIABLES is ignored if STASH is provided, so good to keep in mind.) I think the same could work for "$raw". For filters, we could also alternatively take our $template object, call $template->context(), and then call "define_filter" on that. -- So lots of different ways that could all work. Happy to speak more to the provider stuff as well, since I spent a bit of time at Kohacon2025 and after working on Template provider classes. -- You are receiving this mail because: You are watching all bug changes.