From 70a6226cf7de15a74cb6f82dc14bf4568255fb95 Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Fri, 24 May 2013 14:38:10 +0300 Subject: [PATCH] Bug 10331 - Little errors in unimarc_field_4XX.pl (punctuation) Signed-off-by: Bernardo Gonzalez Kriegel Comment: Work as described, no koha-qa errors Signed-off-by: Katrin Fischer Copying the test plan from the bug report: A. 1) have $a active in one of the linking fields (like 461, 463, etc.). 2) have a biblio record with the field 700 $a, $b, $f filled up 3) go to cataloguing -> field 4XX of your choice, use the plugin to fetch data from biblio rec. mentioned in 2) 4) see the punctuation in $a -- it will be wrong (no closing bracket) B. 1) have $a active in one of the linking fields (like 461, 463, etc.). 2) have a biblio record with the field 700 $a, $b, $c, $f filled up 3) go to cataloguing -> field 4XX of your choice, use the plugin to fetch data from biblio rec. mentioned in 2) 4) see the punctuation in $a -- it will be wrong (dash instead of semicolon between original $c and $f, no closing bracket) C. 1) have $a active in one of the linking fields (like 461, 463, etc.). 2) have a biblio record with the field 702 $a, $b, $c filled up 3) go to cataloguing -> field 4XX of your choice, use the plugin to fetch data from biblio rec. mentioned in 2) 4) see the punctuation in $a -- it will be wrong (unnecessary semicolon after original $c, n.b. lacking space). D. 1) have $a active in one of the linking fields (like 461, 463, etc.). 2) have a biblio record with the field 712 $a, $b filled up 3) go to cataloguing -> field 4XX of your choice, use the plugin to fetch data from biblio rec. mentioned in b) 4) see the punctuation in $a -- it will be wrong (unnecessary opening bracket at the end). Test plan, all tests and QA script pass. Thx Bernardo for his testing and explanations! Signed-off-by: Galen Charlton (cherry picked from commit 86c08e63a25afa86c9051f070d819ddac675425d) Signed-off-by: Tomas Cohen Arazi --- cataloguing/value_builder/unimarc_field_4XX.pl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index e390010358..75862cb67b 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -116,16 +116,19 @@ sub plugin { $subfield_value_a .= " " . $marcrecord->subfield( '700', "d" ) if $marcrecord->subfield( '700', 'd' ); $subfield_value_a .= - " (" . $marcrecord->subfield( '700', 'c' ) . " - " + " (" . $marcrecord->subfield( '700', 'c' ) if $marcrecord->subfield( '700', 'c' ); + $subfield_value_a .= " ; " + if $marcrecord->subfield( '700', 'c' ) + and $marcrecord->subfield( '700', 'f' ); $subfield_value_a .= " (" if ( $marcrecord->subfield( '700', 'f' ) and not( $marcrecord->subfield( '700', 'c' ) ) ); $subfield_value_a .= $marcrecord->subfield( '700', 'f' ) if ( $marcrecord->subfield( '700', 'f' ) ); $subfield_value_a .= ")" - if ( $marcrecord->subfield( '701', 'f' ) - or $marcrecord->subfield( '701', 'c' ) ); + if ( $marcrecord->subfield( '700', 'f' ) + or $marcrecord->subfield( '700', 'c' ) ); } elsif ( $marcrecord->field('702') ) { $subfield_value_a = $marcrecord->subfield( '702', 'a' ); @@ -134,8 +137,11 @@ sub plugin { $subfield_value_a .= " " . $marcrecord->subfield( '702', 'd' ) if $marcrecord->subfield( '702', 'd' ); $subfield_value_a .= - " (" . $marcrecord->subfield( '702', 'c' ) . "; " + " (" . $marcrecord->subfield( '702', 'c' ) if $marcrecord->subfield( '702', 'c' ); + $subfield_value_a .= " ; " + if $marcrecord->subfield( '702', 'c' ) + and $marcrecord->subfield( '702', 'f' ); $subfield_value_a .= " (" if $marcrecord->subfield( '702', 'f' ) and not $marcrecord->subfield( '702', 'c' ); @@ -193,7 +199,7 @@ sub plugin { " (" . $marcrecord->subfield( '712', 'f' ) . " - " if $marcrecord->subfield( '712', 'f' ); $subfield_value_a .= " (" - if $marcrecord->field( '712', "e" ) + if $marcrecord->subfield( '712', "e" ) and not $marcrecord->subfield( '712', 'f' ); $subfield_value_a .= $marcrecord->subfield( '712', 'e' ) if $marcrecord->subfield( '712', 'e' ); -- 2.39.5