Bugzilla – Attachment 159902 Details for
Bug 35070
Koha plugins implementing "background_jobs" hook can't provide view template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35070: Tidy
Bug-35070-Tidy.patch (text/plain), 3.23 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-12-15 20:01:09 UTC
(
hide
)
Description:
Bug 35070: Tidy
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-12-15 20:01:09 UTC
Size:
3.23 KB
patch
obsolete
>From c83e64941cda7c625451936aea712bdd5714ba6e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 15 Dec 2023 16:58:00 -0300 >Subject: [PATCH] Bug 35070: Tidy > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Templates.pm | 6 ++++-- > .../Koha/Plugins/TemplateIncludePathHook.t | 16 ++++++++-------- > t/lib/plugins/Koha/Plugin/Test/inc/test.inc | 2 +- > 3 files changed, 13 insertions(+), 11 deletions(-) > mode change 100644 => 100755 t/db_dependent/Koha/Plugins/TemplateIncludePathHook.t > >diff --git a/C4/Templates.pm b/C4/Templates.pm >index ea10a6bd20e..fb7d3e5cb56 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -62,8 +62,10 @@ sub new { > push @includes, "$htdocs/$_/en/includes" unless $lang eq 'en'; > } > >- my @plugins_include_paths = Koha::Plugins->call( 'template_include_paths', >- { interface => $interface, lang => $lang } ); >+ my @plugins_include_paths = Koha::Plugins->call( >+ 'template_include_paths', >+ { interface => $interface, lang => $lang } >+ ); > push @includes, map { $_ ? @$_ : () } @plugins_include_paths; > > # Do not use template cache if script is called from commandline >diff --git a/t/db_dependent/Koha/Plugins/TemplateIncludePathHook.t b/t/db_dependent/Koha/Plugins/TemplateIncludePathHook.t >old mode 100644 >new mode 100755 >index 674127504c3..0c260c4bd77 >--- a/t/db_dependent/Koha/Plugins/TemplateIncludePathHook.t >+++ b/t/db_dependent/Koha/Plugins/TemplateIncludePathHook.t >@@ -22,20 +22,19 @@ use Test::Warn; > > use File::Basename; > >- > BEGIN { > # Mock pluginsdir before loading Plugins module > my $path = dirname(__FILE__) . '/../../../lib/plugins'; > require t::lib::Mocks; > t::lib::Mocks::mock_config( 'enable_plugins', 1 ); >- t::lib::Mocks::mock_config( 'pluginsdir', $path ); >+ t::lib::Mocks::mock_config( 'pluginsdir', $path ); > > use_ok('Koha::Plugins'); > use_ok('Koha::Plugins::Handler'); > use_ok('Koha::Plugin::Test'); > } > >-my $schema = Koha::Database->new->schema; >+my $schema = Koha::Database->new->schema; > > subtest 'template_include_paths' => sub { > plan tests => 1; >@@ -46,12 +45,13 @@ subtest 'template_include_paths' => sub { > Koha::Plugin::Test->new->enable; > > require C4::Templates; >- my $c4_template = C4::Templates::gettemplate('intranet-main.tt', 'intranet'); >- my $template = $c4_template->{TEMPLATE}; >- my $output = ''; >- $template->process(\"[% INCLUDE test.inc %]", {}, \$output) || die $template->error(); >- is($output, 'included content'); >+ my $c4_template = C4::Templates::gettemplate( 'intranet-main.tt', 'intranet' ); >+ my $template = $c4_template->{TEMPLATE}; >+ my $output = ''; >+ $template->process( \"[% INCLUDE test.inc %]", {}, \$output ) || die $template->error(); >+ is( $output, 'included content' ); > > $schema->storage->txn_commit; >+ > #Koha::Plugins::Methods->delete; > }; >diff --git a/t/lib/plugins/Koha/Plugin/Test/inc/test.inc b/t/lib/plugins/Koha/Plugin/Test/inc/test.inc >index e6edb86a3c2..49c5690fcb4 100644 >--- a/t/lib/plugins/Koha/Plugin/Test/inc/test.inc >+++ b/t/lib/plugins/Koha/Plugin/Test/inc/test.inc >@@ -1 +1 @@ >-[% 'included content' ~%] >+[% 'included content' | html ~%] >-- >2.43.0
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 35070
:
157323
|
159205
|
159248
|
159901
| 159902 |
159938
|
160378
|
160565