From 6ea0cb4651a31bd8671d6679fdca6bb1751ec311 Mon Sep 17 00:00:00 2001 From: Catalyst Bug Squasher Date: Thu, 25 Jul 2024 22:41:58 +0000 Subject: [PATCH] Bug 35792: Use of uninitialized value $sub6 Content-Type: text/plain; charset=utf-8 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 Initial testing done, it works well, needs an additional sign off from an external party Signed-off-by: David Nind Signed-off-by: Marcel de Rooy --- Koha/SearchEngine/Elasticsearch.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index af9bdd97a1..5ef5235720 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -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; } -- 2.30.2