Skip to content
Snippets Groups Projects
Commit 1309a6c7 authored by aydreeihn's avatar aydreeihn
Browse files

Empty extra in list_items

If you have a custom field that's based on a list and the default value is set to a list item where the extra field is empty ('') instead of NULL, you cannot set the default value back to 'Select a Default'. You CAN set it to other default values

Extra is set to empty if you erase the abbreviation and save it. Should save as NULL instead of empty

Note: for some reason this didn't work

if ($k == 'abbrev' && empty($vars[$k]))
                $this->set($v, NULL);
parent 35b260f9
Branches
Tags
No related merge requests found
......@@ -807,7 +807,10 @@ class DynamicListItem extends VerySimpleModel implements CustomListItem {
'sort' => 'sort',
'value' => 'value',
'abbrev' => 'extra') as $k => $v) {
if (isset($vars[$k]))
if ($k == 'abbrev' && empty($vars[$k])) {
$vars[$k] = NULL;
$this->set($v, $vars[$k]);
} elseif (isset($vars[$k]))
$this->set($v, $vars[$k]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment