From 14639d658a1c1637c481642ece090ea6297d4400 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 17 Dec 2024 11:31:27 +0100 Subject: [PATCH] Bug 38723: POC LOAD_FILTERS for raw --- C4/Templates.pm | 3 +++ Koha/Template/Plugin/raw.pm | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/C4/Templates.pm b/C4/Templates.pm index fb7d3e5cb56..c3c7e3a1937 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -77,6 +77,9 @@ sub new { COMPILE_EXT => $use_template_cache ? '.ttc' : '', COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '', INCLUDE_PATH => \@includes, + LOAD_FILTERS => [ + 'Koha::Template::Plugin::raw', + ], FILTERS => {}, ENCODING => 'UTF-8', } diff --git a/Koha/Template/Plugin/raw.pm b/Koha/Template/Plugin/raw.pm index f194a18ae2c..6e38be8be1c 100644 --- a/Koha/Template/Plugin/raw.pm +++ b/Koha/Template/Plugin/raw.pm @@ -17,8 +17,7 @@ package Koha::Template::Plugin::raw; use Modern::Perl; -use Template::Plugin::Filter; -use base qw( Template::Plugin::Filter ); +use base 'Template::Plugin'; our $DYNAMIC = 1; @@ -27,6 +26,13 @@ sub filter { return $text; } +sub fetch { + my ($self) = @_; + return sub { + return shift; + }; +} + 1; =head1 NAME -- 2.34.1