From b56b902f730cc1178498ae4cbc9ad9f60504f1cc Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 11 May 2021 11:08:17 +0000 Subject: [PATCH] Bug 27837: (follow-up) Do not check subfield unless tag defined This was causing extra warnings when the permanent_location field was unmapped. We only need to check if there is a field defined as you can define a mapping without both a field and subfield, so the existence of one implies the other Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 0e00dc78e4ed01678f037a970487fd871fa3e70f) Signed-off-by: Fridolin Somers --- C4/Items.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Items.pm b/C4/Items.pm index eb95a82463..ee1bc5493c 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -309,7 +309,7 @@ sub ModItemFromMarc { my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode, 'items' ); my ( $perm_loc_tag, $perm_loc_subfield ) = C4::Biblio::GetMarcFromKohaField( "items.permanent_location" ); - my $has_permanent_location = defined $item_marc->subfield( $perm_loc_tag, $perm_loc_subfield ); + my $has_permanent_location = defined $perm_loc_tag && defined $item_marc->subfield( $perm_loc_tag, $perm_loc_subfield ); # Retrieving the values for the fields that are not linked my @mapped_fields = Koha::MarcSubfieldStructures->search( -- 2.39.5