Bugzilla – Attachment 175593 Details for
Bug 37634
Missing "USE Koha" causes JS errors and missing "Last patron" menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37634: (follow-up) Add 'Koha' to LOAD_PLUGINS
Bug-37634-follow-up-Add-Koha-to-LOADPLUGINS.patch (text/plain), 4.00 KB, created by
Martin Renvoize (ashimema)
on 2024-12-17 07:58:09 UTC
(
hide
)
Description:
Bug 37634: (follow-up) Add 'Koha' to LOAD_PLUGINS
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-12-17 07:58:09 UTC
Size:
4.00 KB
patch
obsolete
>From ad011c511d63ac6beb13c40df6691bb02fe1c3f5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 17 Dec 2024 07:52:08 +0000 >Subject: [PATCH] Bug 37634: (follow-up) Add 'Koha' to LOAD_PLUGINS > >This patch adds the Koha plugin that's used in almost every template and >include for some basic functions to the LOAD_PLUGINS directive on >Template load.. this way we shouldn't need to keep adding it to the top >of every TT file. >--- > C4/Letters.pm | 1 + > C4/Templates.pm | 14 ++++++++------ > Koha/TemplateUtils.pm | 15 ++++++++------- > xt/author/valid-templates.t | 1 + > 4 files changed, 18 insertions(+), 13 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index ce8ffda7e17..98f1ececcbf 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1737,6 +1737,7 @@ sub _process_tt { > EVAL_PERL => 1, > ABSOLUTE => 1, > PLUGIN_BASE => 'Koha::Template::Plugin', >+ LOAD_PLUGINS => [ 'Koha' ], > COMPILE_EXT => $use_template_cache ? '.ttc' : '', > COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '', > INCLUDE_PATH => \@includes, >diff --git a/C4/Templates.pm b/C4/Templates.pm >index fb7d3e5cb56..d91d038fc6f 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -71,14 +71,16 @@ 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}; > my $template = Template->new( >- { EVAL_PERL => 1, >+ { >+ EVAL_PERL => 1, > ABSOLUTE => 1, >- PLUGIN_BASE => 'Koha::Template::Plugin', >- COMPILE_EXT => $use_template_cache ? '.ttc' : '', >- COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '', >+ PLUGIN_BASE => 'Koha::Template::Plugin', >+ LOAD_PLUGINS => ['Koha'], >+ COMPILE_EXT => $use_template_cache ? '.ttc' : '', >+ COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '', > INCLUDE_PATH => \@includes, >- FILTERS => {}, >- ENCODING => 'UTF-8', >+ FILTERS => {}, >+ ENCODING => 'UTF-8', > } > ) or die Template->error(); > my $self = { >diff --git a/Koha/TemplateUtils.pm b/Koha/TemplateUtils.pm >index aafbaaa6bd3..1ef1f1dc1f4 100644 >--- a/Koha/TemplateUtils.pm >+++ b/Koha/TemplateUtils.pm >@@ -61,13 +61,14 @@ sub process_tt { > > my $tt = Template->new( > { >- EVAL_PERL => 1, >- ABSOLUTE => 1, >- PLUGIN_BASE => 'Koha::Template::Plugin', >- COMPILE_EXT => $use_template_cache ? '.ttc' : '', >- COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '', >- FILTERS => {}, >- ENCODING => 'UTF-8', >+ EVAL_PERL => 1, >+ ABSOLUTE => 1, >+ PLUGIN_BASE => 'Koha::Template::Plugin', >+ LOAD_PLUGINS => ['Koha'], >+ COMPILE_EXT => $use_template_cache ? '.ttc' : '', >+ COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '', >+ FILTERS => {}, >+ ENCODING => 'UTF-8', > } > ) or die Template->error(); > >diff --git a/xt/author/valid-templates.t b/xt/author/valid-templates.t >index 3724d035756..cf4a83c5ec3 100755 >--- a/xt/author/valid-templates.t >+++ b/xt/author/valid-templates.t >@@ -127,6 +127,7 @@ sub create_template_test { > ABSOLUTE => 1, > INCLUDE_PATH => $includes, > PLUGIN_BASE => 'Koha::Template::Plugin', >+ LOAD_PLUGINS => [ 'Koha' ], > } > ); > foreach my $exclusion (@exclusions) { >-- >2.47.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 37634
:
174986
|
175038
|
175447
|
175591
|
175592
|
175593
|
175594