https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43975 Bug ID: 43975 Summary: AutoCreateAuthorities creates authority 1XX fields with empty indicators + solution Initiative type: --- Sponsorship --- status: Product: Koha Version: 25.05 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: viliam.polonec@snk.sk QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- When AutoCreateAuthorities (together with BiblioAddsAuthorities) is enabled and no matching authority is found, Koha creates a new authority record in C4::Biblio::LinkBibHeadingsToAuthorities. The heading field is built with empty strings as indicators: my $authfield = MARC::Field->new( $authority_type->auth_tag_to_report, '', '', @auth_subfields ); As a result, the authority record is saved with empty indicators (ind1="" ind2="" in MARCXML) instead of valid values. This is invalid MARC 21. The record fails validation in external tools, and information present in the bibliographic heading (e.g. the type of personal name in ind1 of 100/600/700) is lost. Steps to reproduce: Enable the system preferences BiblioAddsAuthorities and AutoCreateAuthorities. Create or edit a bibliographic record and add a 700 field with ind1 = 1 and a personal name that has no authority record, e.g. 700 1# $a Testovací, Autor. Save the record. Open the newly created authority record and view the MARC (or export it as MARCXML). Actual result: The 100 field of the new authority has empty indicators (ind1="" ind2=""). Expected result: For personal, corporate and meeting names (authority 100/110/111), ind1 should be copied from the bibliographic heading field (here 100 1#). For other heading types the indicators should be blanks (‘ ‘), not empty strings. Proposed solution: Take ind1 from the bibliographic field for 100/110/111 and default to a blank in all other cases: --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ LinkBibHeadingsToAuthorities - my $authfield = MARC::Field->new( $authority_type->auth_tag_to_report, '', '', @auth_subfields ); + my $auth_tag = $authority_type->auth_tag_to_report; + my ( $ind1, $ind2 ) = ( ' ', ' ' ); + if ( $auth_tag =~ /^1(?:00|10|11)$/ ) { + my $bib_ind1 = $field->indicator(1); + $ind1 = $bib_ind1 if defined $bib_ind1 && $bib_ind1 =~ /^[0-9]$/; + } + my $authfield = MARC::Field->new( $auth_tag, $ind1, $ind2, @auth_subfields ); -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.