Browse Source

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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11/bug30761
Marcel de Rooy 2 years ago
committed by Jonathan Druart
parent
commit
35ad731102
  1. 2
      Koha/UI/Form/Builder/Item.pm

2
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 <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value

Loading…
Cancel
Save