From b21be4f35eb4c68ce05603c630f508439e31573c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 20 Jul 2021 12:09:55 +0200 Subject: [PATCH] Bug 27526: Fix empty string vs undef Empty strings must be removed, not inserted as empty strings in DB. The relevant code is in TransformHtmlToXml, $skip variable. Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- cataloguing/additem.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index f4b059f379..4a10594dd5 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -450,9 +450,13 @@ if ($op eq "additem") { } $item->more_subfields_xml(undef); } else { - my @v = $input->multi_param("items.".$c); - next unless @v; - $item->$c(join ' | ', uniq @v); + my @v = grep { $_ ne "" } + uniq $input->multi_param( "items." . $c ); + + next if !@v + && $c ne 'permanent_location'; # See 27837 + + $item->$c(join ' | ', @v); } } -- 2.39.5