Bug 36917: Remove some warnings from t/db_dependent/Authority/Merge.t

Cannot determine authority type for record: 1709 at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 589.
Use of uninitialized value $subfields in pattern match (m//) at /kohadevbox/koha/C4/Heading/MARC21.pm line 412.
Use of uninitialized value $subfields in pattern match (m//) at /kohadevbox/koha/C4/Heading/MARC21.pm line 448.

This change removes the 2 "Use of uninitialized value $subfields in
pattern match (m//)" warnings

The warnings are gnerated because the subfields for headings are hardcoded variables in C4::Heading::MARC21
for any genuine authority record we should receive the correct list of subfields. The tests in this case are
mocking a new authtype, and so do not find the correct subfields. Skipping the generation here silences the
warnings and will prevent user defined types from throwing errors as well.

NOTE: Koha allows the user to define their own authority types, however, we have various features hardcoded
that will prevent them from working as expected

WNC amended commit message

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-05-22 10:56:10 +02:00 committed by Katrin Fischer
parent 09d2c0ac10
commit 1d394dcdcc
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 2 additions and 0 deletions

View File

@ -402,6 +402,7 @@ sub _get_search_heading {
my $subfields = shift;
my $heading = "";
return $heading unless $subfields;
my @subfields = $field->subfields();
my $first = 1;
for ( my $i = 0 ; $i <= $#subfields ; $i++ ) {
@ -439,6 +440,7 @@ sub _get_display_heading {
my $subfields = shift;
my $heading = "";
return $heading unless $subfields;
my @subfields = $field->subfields();
my $first = 1;
for ( my $i = 0 ; $i <= $#subfields ; $i++ ) {