Assign empty value for unset fields. Fix bug in test.

This commit is contained in:
2016-07-10 21:56:19 +02:00
parent ebc0c89fcc
commit 918026fca4
2 changed files with 8 additions and 3 deletions

View File

@@ -93,8 +93,12 @@ class FieldDefinition
$groupName = $this->fieldData['groups'][$meta['group']];
$meta['group_name'] = $groupName;
if (isset($meta['default']) && (!isset($meta['value']) || empty($meta['value']))) {
$meta['value'] = $meta['default'];
if (!isset($meta['value']) || empty($meta['value'])) {
if (isset($meta['default'])) {
$meta['value'] = $meta['default'];
} else {
$meta['value'] = '';
}
}
// Field type marker for Mustache