Bugzilla – Attachment 35053 Details for
Bug 12404
CSV profiles improvements (concatenations, substrings, conditions...)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12404: Allow equal sign '=' in the TT directive
PASSED-QA-Bug-12404-Allow-equal-sign--in-the-TT-di.patch (text/plain), 2.63 KB, created by
Kyle M Hall (khall)
on 2015-01-09 12:48:09 UTC
(
hide
)
Description:
[PASSED QA] Bug 12404: Allow equal sign '=' in the TT directive
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-01-09 12:48:09 UTC
Size:
2.63 KB
patch
obsolete
>From 1b587682acb5cd1e1352de024570c1b25a1c061b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 5 Nov 2014 17:10:58 +0100 >Subject: [PATCH] [PASSED QA] 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> >--- > C4/Record.pm | 4 ++-- > t/db_dependent/Record/marcrecord2csv.t | 11 ++++++++++- > 2 files changed, 12 insertions(+), 3 deletions(-) > >diff --git a/C4/Record.pm b/C4/Record.pm >index c83d1a3..8e6911c 100644 >--- a/C4/Record.pm >+++ b/C4/Record.pm >@@ -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=?"; >diff --git a/t/db_dependent/Record/marcrecord2csv.t b/t/db_dependent/Record/marcrecord2csv.t >index aa4baec..2ed797b 100644 >--- a/t/db_dependent/Record/marcrecord2csv.t >+++ b/t/db_dependent/Record/marcrecord2csv.t >@@ -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}; >-- >1.7.2.5
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 12404
:
28767
|
28768
|
28769
|
28770
|
28771
|
33170
|
33171
|
33172
|
33173
|
33174
|
33263
|
33477
|
34288
|
34289
|
34290
|
34291
|
34292
|
34293
|
34294
|
34300
|
34301
|
34302
|
34303
|
34405
|
34406
|
34407
|
34408
|
34409
|
34410
|
34411
|
35048
|
35049
|
35050
|
35051
|
35052
| 35053 |
35054