From e93bb2958dc773d5a1f6536f8793f515a64e3713 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 2 Nov 2020 13:48:39 +0000 Subject: [PATCH] Bug 40559: Fix noisy warning in MARCdetail Rebased for 25.06. Resolves: Use of uninitialized value in string eq at /usr/share/koha/catalogue/MARCdetail.pl line 203. Test plan: Make sure that there is a combination of framework/field/subfield having an entry in marc_subfield_structure where kohafield is NULL. To force this for default fw on 020$q: update marc_subfield_structure set kohafield=NULL where tagfield='020' and tagsubfield='q' and frameworkcode=''; Pick a biblio in this framework having that field/subfield. Or create a 020 with $q filled. Hit catalogue/MARCdetail now. Without this patch, it triggers the warn. With this patch, it does not. Signed-off-by: Marcel de Rooy Signed-off-by: Lucas Gass (cherry picked from commit 40d1cdeeb17e8c648f05491503f3864c06734f9d) Signed-off-by: Paul Derscheid (cherry picked from commit 96c574853dc12c2b12d4261bea438772e8536414) Signed-off-by: Fridolin Somers --- catalogue/MARCdetail.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index bcb6f5e972..e630d18344 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -200,9 +200,8 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { { $subfield_data{marc_value} = $subf[$i][1]; $subfield_data{is_url} = 1; - } - elsif ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] } - ->{kohafield} eq "biblioitems.isbn" ) + } elsif ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{kohafield} + && $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{kohafield} eq "biblioitems.isbn" ) { # warn " tag : ".$tagslib->{$fields[$x_i]->tag()}." subfield :".$tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}. "ISBN : ".$subf[$i][1]."PosttraitementISBN :".DisplayISBN($subf[$i][1]);