Bug 33045: Use process_tt in C4::Record::marcrecord2csv
Bug 33030 implements a new helper subroutine to standardize processing of Template Toolkit syntax outside slips and notices. We should use this subroutine in marcrecord2csv. Test Plan: 1) Apply this patch 2) prove t/db_dependent/Record/marcrecord2csv.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
93d4defeda
commit
d00feafe75
1 changed files with 2 additions and 4 deletions
|
@ -38,6 +38,7 @@ use Koha::SimpleMARC qw( read_field );
|
|||
use Koha::XSLT::Base;
|
||||
use Koha::CsvProfiles;
|
||||
use Koha::AuthorisedValues;
|
||||
use Koha::TemplateUtils qw( process_tt );
|
||||
use Carp qw( carp croak );
|
||||
|
||||
use vars qw(@ISA @EXPORT);
|
||||
|
@ -564,13 +565,10 @@ sub marcrecord2csv {
|
|||
|
||||
# TT tags exist
|
||||
if ( $content =~ m|\[\%.*\%\]| ) {
|
||||
my $tt = Template->new();
|
||||
my $template = $content;
|
||||
# Replace 00X and 0XX with X or XX
|
||||
$content =~ s|fields.00(\d)|fields.$1|g;
|
||||
$content =~ s|fields.0(\d{2})|fields.$1|g;
|
||||
my $tt_output;
|
||||
$tt->process( \$content, $field_list, \$tt_output );
|
||||
my $tt_output = process_tt( $content, $field_list );
|
||||
push @csv_rows, $tt_output;
|
||||
} else {
|
||||
for my $tag ( @$tags ) {
|
||||
|
|
Loading…
Reference in a new issue