@@ -, +, @@
C4::Biblio::TransformHtmlToMarc
---------
1) Back up your intranet error log
-- for example:
cp ~/koha-dev/var/log/koha-error-log ~/koha-error-log.backup
2) Blank your intranet error log
-- for example:
echo > ~/koha-dev/var/log/koha-error-log
3) Log into your staff client
4) Click 'Authorities'
5) Click 'New from Z39.50'
5) Type 'Seuss' into 'Name (any):' and press enter
6) Click 'Import' beside the first link
7) Click 'Save'
8) Check your koha-error-log
-- floody!
9) Apply patch
-- blank!
-- for example:
mv ~/koha-error-log.backup ~/koha-dev/var/log/koha-error-log
---
C4/Biblio.pm | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
--- a/C4/Biblio.pm
+++ a/C4/Biblio.pm
@@ -2574,18 +2574,19 @@ sub TransformHtmlToMarc {
if ( $tag < 10 ) { # no code for theses fields
# in MARC editor, 000 contains the leader.
next if $tag == $biblionumbertagfield;
+ my $fval= $cgi->param($params[$j+1]);
if ( $tag eq '000' ) {
# Force a fake leader even if not provided to avoid crashing
# during decoding MARC record containing UTF-8 characters
$record->leader(
- length( $cgi->param($params[$j+1]) ) == 24
- ? $cgi->param( $params[ $j + 1 ] )
+ length( $fval ) == 24
+ ? $fval
: ' nam a22 4500'
)
;
# between 001 and 009 (included)
- } elsif ( $cgi->param( $params[ $j + 1 ] ) ne '' ) {
- $newfield = MARC::Field->new( $tag, $cgi->param( $params[ $j + 1 ] ), );
+ } elsif ( $fval ne '' ) {
+ $newfield = MARC::Field->new( $tag, $fval, );
}
# > 009, deal with subfields
@@ -2599,13 +2600,14 @@ sub TransformHtmlToMarc {
#if next param ne subfield, then it was probably empty
#try next param by incrementing j
if($params[$j+1]!~/_subfield_/) {$j++; next; }
+ my $fkey= $cgi->param($params[$j]);
my $fval= $cgi->param($params[$j+1]);
#check if subfield value not empty and field exists
if($fval ne '' && $newfield) {
- $newfield->add_subfields( $cgi->param($params[$j]) => $fval);
+ $newfield->add_subfields( $fkey => $fval);
}
elsif($fval ne '') {
- $newfield = MARC::Field->new( $tag, $ind1, $ind2, $cgi->param($params[$j]) => $fval );
+ $newfield = MARC::Field->new( $tag, $ind1, $ind2, $fkey => $fval );
}
$j += 2;
} #end-of-while
--