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

(-)a/C4/Biblio.pm (-7 / +2 lines)
Lines 2515-2527 sub TransformHtmlToMarc { Link Here
2515
2515
2516
    # creating a new record
2516
    # creating a new record
2517
    my $record = MARC::Record->new();
2517
    my $record = MARC::Record->new();
2518
    my $i      = 0;
2519
    my @fields;
2518
    my @fields;
2520
    my ($biblionumbertagfield, $biblionumbertagsubfield) = (-1, -1);
2519
    my ($biblionumbertagfield, $biblionumbertagsubfield) = (-1, -1);
2521
    ($biblionumbertagfield, $biblionumbertagsubfield) =
2520
    ($biblionumbertagfield, $biblionumbertagsubfield) =
2522
        &GetMarcFromKohaField( "biblio.biblionumber", '' ) if $isbiblio;
2521
        &GetMarcFromKohaField( "biblio.biblionumber", '' ) if $isbiblio;
2523
#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!
2522
#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!
2524
    while ( $params[$i] ) {    # browse all CGI params
2523
    for (my $i = 0; $params[$i]; $i++ ) {    # browse all CGI params
2525
        my $param    = $params[$i];
2524
        my $param    = $params[$i];
2526
        my $newfield = 0;
2525
        my $newfield = 0;
2527
2526
Lines 2543-2551 sub TransformHtmlToMarc { Link Here
2543
2542
2544
            if ( $tag < 10 ) {                              # no code for theses fields
2543
            if ( $tag < 10 ) {                              # no code for theses fields
2545
                                                            # in MARC editor, 000 contains the leader.
2544
                                                            # in MARC editor, 000 contains the leader.
2546
                if ( $tag == $biblionumbertagfield ) {
2545
                next if $tag == $biblionumbertagfield;
2547
                    # We do nothing and let $i be incremented
2548
                }
2549
                elsif ( $tag eq '000' ) {
2546
                elsif ( $tag eq '000' ) {
2550
                    # Force a fake leader even if not provided to avoid crashing
2547
                    # Force a fake leader even if not provided to avoid crashing
2551
                    # during decoding MARC record containing UTF-8 characters
2548
                    # during decoding MARC record containing UTF-8 characters
Lines 2585-2591 sub TransformHtmlToMarc { Link Here
2585
            }
2582
            }
2586
            push @fields, $newfield if ($newfield);
2583
            push @fields, $newfield if ($newfield);
2587
        }
2584
        }
2588
        $i++;
2589
    }
2585
    }
2590
2586
2591
    $record->append_fields(@fields);
2587
    $record->append_fields(@fields);
2592
- 

Return to bug 6657