From 482c08bbfa295204e94d211096a99b5f35b3a3ce 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 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 Signed-off-by: Katrin Fischer (cherry picked from commit b8049af6b1e2c7de954ffc08e22acc08031fd290) Signed-off-by: Lucas Gass --- 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 531d410e5b..e27036bc1a 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.39.5