Bugzilla – Attachment 175604 Details for
Bug 38723
Move widely used TT plugins to LOAD_PLUGINS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38723: POC LOAD_FILTERS for raw
Bug-38723-POC-LOADFILTERS-for-raw.patch (text/plain), 1.75 KB, created by
Jonathan Druart
on 2024-12-17 10:31:45 UTC
(
hide
)
Description:
Bug 38723: POC LOAD_FILTERS for raw
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-12-17 10:31:45 UTC
Size:
1.75 KB
patch
obsolete
>From bf5ccccb527bb6496d642e6dc9612e929e31e8de Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 17 Dec 2024 11:31:27 +0100 >Subject: [PATCH] Bug 38723: POC LOAD_FILTERS for raw > >--- > C4/Templates.pm | 4 ++++ > Koha/Template/Plugin/raw.pm | 10 ++++++++-- > 2 files changed, 12 insertions(+), 2 deletions(-) > >diff --git a/C4/Templates.pm b/C4/Templates.pm >index fb7d3e5cb56..8c7fe6e9978 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -70,6 +70,7 @@ sub new { > > # Do not use template cache if script is called from commandline > my $use_template_cache = C4::Context->config('template_cache_dir') && defined $ENV{GATEWAY_INTERFACE}; >+ use Koha::Template::Plugin::raw; > my $template = Template->new( > { EVAL_PERL => 1, > ABSOLUTE => 1, >@@ -77,6 +78,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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38723
:
175601
|
175602
|
175604
|
175605
|
175606