Fix how update and addRevision handle defaults from the definition subroutine
when it returns an array ref.
This commit is contained in:
parent
c7fcd40a25
commit
c6e9d322a8
4 changed files with 10 additions and 1 deletions
|
|
@ -2270,6 +2270,9 @@ sub update {
|
|||
# use the default value because default and update were both undef
|
||||
if ($value eq "" && exists $definition->{properties}{$property}{defaultValue}) {
|
||||
$value = $definition->{properties}{$property}{defaultValue};
|
||||
if (ref($value) eq 'ARRAY') {
|
||||
$value = $value->[0];
|
||||
}
|
||||
}
|
||||
|
||||
# set the property
|
||||
|
|
|
|||
|
|
@ -126,6 +126,9 @@ sub addRevision {
|
|||
# get the default values of each property
|
||||
foreach my $property (keys %{$definition->{properties}}) {
|
||||
$defaults{$property} = $definition->{properties}{$property}{defaultValue};
|
||||
if (ref($defaults{$property}) eq 'ARRAY') {
|
||||
$defaults{$property} = $defaults{$property}->[0];
|
||||
}
|
||||
}
|
||||
|
||||
# prime the tables
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue