From 35ad7311022e0385505388070305ac8c1322d5de Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 27 Oct 2021 12:07:03 +0000 Subject: [PATCH] Bug 29146: Same for item editor Test plan: Put some defaultvalue in an item subfield. Test adding new item; is defaultvalue supplied already? Test adding existing item. Clear the subfield. Save. Open again. Is the subfield still empty now? Signed-off-by: Marcel de Rooy Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- Koha/UI/Form/Builder/Item.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm index 64a0b92590..5efe6ed796 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -119,7 +119,7 @@ sub generate_subfield_form { $subfield->{kohafield} || 'items.more_subfields_xml'; if ( $prefill_with_default_values && ( !defined($value) || $value eq '' ) ) { - $value = $subfield->{defaultvalue}; + $value = $subfield->{defaultvalue} if !$item->{itemnumber}; # apply defaultvalue only to new items if ($value) { # get today date & replace <>, <>, <>, <
> if provided in the default value -- 2.39.5