Bug 35792: Use of uninitialized value $sub6

Test plan:

1. Apply patch
2. Rerun and make sure the error "Use of uninitialized value $sub6 in pattern match (m//) at /usr/share/koha/lib/Koha/SearchEngine/Elastricsearch.pm" is no longer present.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Initial testing done, it works well, needs an additional sign off from an external party

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Catalyst Bug Squasher 2024-07-25 22:41:58 +00:00 committed by Katrin Fischer
parent 938053b1cf
commit b8049af6b1
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 1 deletions

View File

@ -616,7 +616,7 @@ sub marc_records_to_documents {
my $altscript = 0;
if ($marcflavour eq 'marc21' && $tag eq '880') {
my $sub6 = $field->subfield('6');
if ($sub6 =~ /^(...)-\d+/) {
if ($sub6 && $sub6 =~ /^(...)-\d+/) {
$tag = $1;
$altscript = 1;
}