From 497ed0f369416d91e70540afe2b0da3148391b54 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 27 Apr 2022 22:53:47 +0000 Subject: [PATCH] Bug 30358: (follow-up) Consider field has multiple subfields of same key To test: 1) Click the clone subfield button to make multiple subfields with the same key, i.e. 500$a$a$a 2) Save the record and confirm that the fields contain the correct data after whitespaces are stripped. Signed-off-by: David Nind Signed-off-by: Kyle M Hall --- C4/Biblio.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index ed3b07658b..3277bf358d 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2818,7 +2818,8 @@ sub ModBiblioMarc { my $value = $subfield->[1]; $value =~ s/[\n\r]+/ /g; $value =~ s/^\s+|\s+$|^\t+|\t+$//g; - $field->update( $key => $value ); + $field->add_subfields( $key => $value ); # add subfield to the end of the subfield list + $field->delete_subfield( pos => 0 ); # delete the subfield at the top of the subfield list } } } -- 2.30.2