better handling of defaults
This commit is contained in:
parent
116b7c6e17
commit
227e9e7dac
1 changed files with 3 additions and 1 deletions
|
|
@ -928,7 +928,9 @@ sub update {
|
|||
}
|
||||
|
||||
# set a default value if it's empty or undef
|
||||
$data->{$property} ||= $properties->{$property}{defaultValue};
|
||||
if ($data->{$property} eq "") {
|
||||
$data->{$property} = $properties->{$property}{defaultValue};
|
||||
}
|
||||
|
||||
# serialize if needed
|
||||
if ($properties->{$property}{serialize} && $data->{property} ne "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue