[Koha-bugs] [Bug 33039] Add ability to specify a template for serial subscription "Published on (text)" field

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 28 09:54:02 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33039

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|BLOCKED                     |Failed QA

--- Comment #14 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
+        if ( index( $template, '[%' ) != -1 ) { # Much faster than regex
No problem, but 'much' sounds like exaggerating :) Just in memory..
The variable name could be confusing btw. It is template code.

This call worries me:
+            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',
+                }
+            ) or die Template->error();
Would prefer to see calling something central like in C4::Templates or in
C4::Letters instead.

+            $schema->txn_begin;
+            try {
+                my $text;
+                $tt->process(
Please explain why a process call would need a transaction. Can we just remove
it ?

Could generating alternative text via a Koha plugin be easier somehow? And
without needing a db revision ?
Note that we already have:
Koha/Plugins/Base.pm:    $args->{'template'} = Template->new( { ABSOLUTE => 1,
ENCODING => 'UTF-8' } );

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list