Skip to content
Permalink
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);
  • Loading branch information...
aydreeihn committed May 23, 2019
1 parent 35b260f commit 1309a6c7f3996015a40c16c4f28c3169ecb75c07
Showing with 4 additions and 1 deletion.
  1. +4 −1 include/class.list.php
@@ -807,7 +807,10 @@ function update($vars, &$errors=array()) {
'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 comments on commit 1309a6c

Please sign in to comment.
You can’t perform that action at this time.