From 106ac91efd0c6ed57e05010ac0b518f4db649d79 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 17 Dec 2024 11:57:26 +0000 Subject: [PATCH] Bug 38723: WIP Fix valid-templates.t I'm not sure why/how this works.. and it doesn't resolve all issues and will need applying to the Template calls in proper Koha and not just the tests too I believe --- xt/author/valid-templates.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xt/author/valid-templates.t b/xt/author/valid-templates.t index de93b9493c8..ca52423e701 100755 --- a/xt/author/valid-templates.t +++ b/xt/author/valid-templates.t @@ -37,6 +37,8 @@ This test checks all staff and OPAC templates and includes for syntax errors use File::Find; use File::Spec; use Template; +use Template::Plugins; +use Koha::Template::Plugin::raw; use Test::More; my @themes; @@ -121,13 +123,19 @@ sub create_template_test { my $interface = $includes =~ s|^.*/([^/]*-tmpl).*$|$1|r; my $theme = ($interface =~ /opac/) ? 'bootstrap' : 'prog'; + my $plugins = Template::Plugins->new( { PLUGIN_BASE => 'Koha::Template::Plugin' } ); + return sub { my $tt = Template->new( { ABSOLUTE => 1, INCLUDE_PATH => $includes, PLUGIN_BASE => 'Koha::Template::Plugin', - LOAD_PLUGINS => [ 'Koha', 'Asset', 'raw' ], + LOAD_PLUGINS => [ $plugins ], + LOAD_FILTERS => [ + 'Koha::Template::Plugin::raw', + ], + FILTERS => {} } ); foreach my $exclusion (@exclusions) { -- 2.47.1