Bug 12404: Allow equal sign '=' in the TT directive
Signed-off-by: Courret <scourret@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
57b48279bd
commit
20ec29eb19
|
|
@ -462,7 +462,7 @@ sub marcrecord2csv {
|
|||
# Separating the marcfields from the user-supplied headers
|
||||
my @csv_structures;
|
||||
foreach (@marcfieldsarray) {
|
||||
my @result = split('=', $_);
|
||||
my @result = split('=', $_, 2);
|
||||
my $content = ( @result == 2 )
|
||||
? $result[1]
|
||||
: $result[0];
|
||||
|
|
@ -516,7 +516,7 @@ sub marcrecord2csv {
|
|||
my $tag = $tags->[0];
|
||||
if ( $tag->{subfieldtag} ) {
|
||||
my $query = "SELECT liblibrarian FROM marc_subfield_structure WHERE tagfield=? AND tagsubfield=?";
|
||||
my @results = $dbh->selectrow_array( $query, {}, $tag->{subfieldtag} );
|
||||
my @results = $dbh->selectrow_array( $query, {}, $tag->{fieldtag}, $tag->{subfieldtag} );
|
||||
push @marcfieldsheaders, $results[0];
|
||||
} else {
|
||||
my $query = "SELECT liblibrarian FROM marc_tag_structure WHERE tagfield=?";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/perl;
|
||||
|
||||
use Modern::Perl;
|
||||
use Test::More tests => 8;
|
||||
use Test::More tests => 9;
|
||||
use Test::MockModule;
|
||||
use MARC::Record;
|
||||
use MARC::Field;
|
||||
|
|
@ -79,6 +79,15 @@ is( $csv_output, q[Title
|
|||
"The art of computer programming"
|
||||
], q|TT way: display first subfield a for first field 245 if indicator 1 for field 100 is set| );
|
||||
|
||||
$csv_content = q|Title=[% IF fields.100.0.indicator.1 == 1 %][% fields.245.0.a.0 %][% END %]|;
|
||||
my $csv_profile_id_7 = insert_csv_profile({ csv_content => $csv_content });
|
||||
|
||||
$csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_7, 1, $csv );
|
||||
is( $csv_output, q[Title
|
||||
"The art of computer programming"
|
||||
], q|TT way: display first subfield a for first field 245 if indicator 1 == 1 for field 100 is set| );
|
||||
|
||||
|
||||
sub insert_csv_profile {
|
||||
my ( $params ) = @_;
|
||||
my $csv_content = $params->{csv_content};
|
||||
|
|
|
|||
Loading…
Reference in New Issue