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

(-)a/C4/Biblio.pm (-9 / +15 lines)
Lines 542-557 sub LinkBibHeadingsToAuthorities { Link Here
542
                    }
542
                    }
543
                    $field->delete_subfield( code => '9' )
543
                    $field->delete_subfield( code => '9' )
544
                      if defined $current_link;
544
                      if defined $current_link;
545
                    my $authfield =
545
                    my @auth_subfields;
546
                      MARC::Field->new( $authority_type->auth_tag_to_report,
546
                    foreach my $subfield ( $field->subfields() ){
547
                        '', '', "a" => "" . $field->subfield('a') );
547
                        if ( $subfield->[0] =~ /[A-z]/
548
                    map {
549
                        $authfield->add_subfields( $_->[0] => $_->[1] )
550
                          if ( $_->[0] =~ /[A-z]/ && $_->[0] ne "a"
551
                            && C4::Heading::valid_bib_heading_subfield(
548
                            && C4::Heading::valid_bib_heading_subfield(
552
                                $field->tag, $_->[0] )
549
                                $field->tag, $subfield->[0] )
553
                            );
550
                           ){
554
                    } $field->subfields();
551
                            push @auth_subfields, $subfield->[0] => $subfield->[1];
552
                        }
553
                    }
554
                    # Bib headings contain some ending punctuation that should NOT
555
                    # be included in the authority record. Strip those before creation
556
                    next unless @auth_subfields; # Don't try to create a record if we have no fields;
557
                    my $last_sub = pop @auth_subfields;
558
                    $last_sub =~ s/[\s]*[,.:=;!%\/][\s]*$//;
559
                    push @auth_subfields, $last_sub;
560
                    my $authfield = MARC::Field->new( $authority_type->auth_tag_to_report, '', '', @auth_subfields );
555
                    $marcrecordauth->insert_fields_ordered($authfield);
561
                    $marcrecordauth->insert_fields_ordered($authfield);
556
562
557
# bug 2317: ensure new authority knows it's using UTF-8; currently
563
# bug 2317: ensure new authority knows it's using UTF-8; currently
(-)a/C4/Heading/MARC21.pm (-2 / +1 lines)
Lines 256-262 sub _get_search_heading { Link Here
256
        my $code    = $subfields[$i]->[0];
256
        my $code    = $subfields[$i]->[0];
257
        my $code_re = quotemeta $code;
257
        my $code_re = quotemeta $code;
258
        my $value   = $subfields[$i]->[1];
258
        my $value   = $subfields[$i]->[1];
259
        $value =~ s/[-,.:=;!%\/]$//;
259
        $value =~ s/[\s]*[-,.:=;!%\/][\s]*$//;
260
        next unless $subfields =~ qr/$code_re/;
260
        next unless $subfields =~ qr/$code_re/;
261
        if ($first) {
261
        if ($first) {
262
            $first   = 0;
262
            $first   = 0;
263
- 

Return to bug 24094