From 9e5aedbf4346e45583e58e66ab866b102feb6aac Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 3 Jul 2025 13:55:09 +0100 Subject: [PATCH] Bug 37305: (follow-up) Only add control number subfield when defined The previous commit introduced a bug where the control number subfield 'w' was being added to the MARC field even when undefined, causing test failures. This patch adds a condition to only push the control number subfield when the value is actually defined, matching the pattern used for other subfields in the method. Signed-off-by: Martin Renvoize --- Koha/Biblio.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 4f0c0bf1f92..45b9b27fc76 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -2013,7 +2013,7 @@ sub generate_marc_host_field { $w = '(' . $host_field->data() . ')' . $w; } - push @sfd, ( w => $w ); + push @sfd, ( w => $w ) if $w; } $link_field = MARC::Field->new( 773, '0', ' ', @sfd ); } elsif ( $marcflavour eq 'UNIMARC' ) { -- 2.50.0