From bb561c72641e84f040864f3c4a62c13e9d453408 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. --- cataloguing/additem.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 85b03da86e8..9150ad2b785 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -449,9 +449,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.20.1