View | Details | Raw Unified | Return to bug 6657
Collapse All | Expand All

(-)a/C4/Biblio.pm (-2 / +3 lines)
Lines 2496-2501 sub TransformHtmlToMarc { Link Here
2496
    my $record = MARC::Record->new();
2496
    my $record = MARC::Record->new();
2497
    my $i      = 0;
2497
    my $i      = 0;
2498
    my @fields;
2498
    my @fields;
2499
    my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
2499
#FIXME This code assumes that the CGI params will be in the same order as the fields in the template; this is no absolute guarantee!
2500
#FIXME This code assumes that the CGI params will be in the same order as the fields in the template; this is no absolute guarantee!
2500
    while ( $params[$i] ) {    # browse all CGI params
2501
    while ( $params[$i] ) {    # browse all CGI params
2501
        my $param    = $params[$i];
2502
        my $param    = $params[$i];
Lines 2503-2509 sub TransformHtmlToMarc { Link Here
2503
2504
2504
        # if we are on biblionumber, store it in the MARC::Record (it may not be in the edited fields)
2505
        # if we are on biblionumber, store it in the MARC::Record (it may not be in the edited fields)
2505
        if ( $param eq 'biblionumber' ) {
2506
        if ( $param eq 'biblionumber' ) {
2506
            my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
2507
            if ( $biblionumbertagfield < 10 ) {
2507
            if ( $biblionumbertagfield < 10 ) {
2508
                $newfield = MARC::Field->new( $biblionumbertagfield, $cgi->param($param), );
2508
                $newfield = MARC::Field->new( $biblionumbertagfield, $cgi->param($param), );
2509
            } else {
2509
            } else {
Lines 2520-2525 sub TransformHtmlToMarc { Link Here
2520
2520
2521
            if ( $tag < 10 ) {                              # no code for theses fields
2521
            if ( $tag < 10 ) {                              # no code for theses fields
2522
                                                            # in MARC editor, 000 contains the leader.
2522
                                                            # in MARC editor, 000 contains the leader.
2523
                next if $tag == $biblionumbertagfield;
2523
                if ( $tag eq '000' ) {
2524
                if ( $tag eq '000' ) {
2524
                    # Force a fake leader even if not provided to avoid crashing
2525
                    # Force a fake leader even if not provided to avoid crashing
2525
                    # during decoding MARC record containing UTF-8 characters
2526
                    # during decoding MARC record containing UTF-8 characters
Lines 2539-2544 sub TransformHtmlToMarc { Link Here
2539
                # browse subfields for this tag (reason for _code_ match)
2540
                # browse subfields for this tag (reason for _code_ match)
2540
                while(defined $params[$j] && $params[$j] =~ /_code_/) {
2541
                while(defined $params[$j] && $params[$j] =~ /_code_/) {
2541
                    last unless defined $params[$j+1];
2542
                    last unless defined $params[$j+1];
2543
                    $j += 2 and next if $tag == $biblionumbertagfield and $cgi->param($params[$j]) eq $biblionumbertagsubfield;
2542
                    #if next param ne subfield, then it was probably empty
2544
                    #if next param ne subfield, then it was probably empty
2543
                    #try next param by incrementing j
2545
                    #try next param by incrementing j
2544
                    if($params[$j+1]!~/_subfield_/) {$j++; next; }
2546
                    if($params[$j+1]!~/_subfield_/) {$j++; next; }
2545
- 

Return to bug 6657