Fix bug with empty / '' select option being rejected

This commit is contained in:
Nathan Gray 2012-07-24 22:55:49 +00:00
parent 778ecd04ba
commit 63fb4f1c7f

View File

@ -93,7 +93,7 @@ class etemplate_widget_menupopup extends etemplate_widget
{ {
// Special for select-account - selOptions doesn't always load all accounts // Special for select-account - selOptions doesn't always load all accounts
if($this->attrs['type'] == 'select-account' && !$GLOBALS['egw']->accounts->visible($val) && !isset($allowed[$val]) || if($this->attrs['type'] == 'select-account' && !$GLOBALS['egw']->accounts->visible($val) && !isset($allowed[$val]) ||
$this->attrs['type'] != 'select-account' && !($this->attrs['multiple'] && !$val) && !isset($allowed[$val])) $this->attrs['type'] != 'select-account' && !array_key_exists($val,$allowed))
{ {
self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($allowed))),''); self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($allowed))),'');
$value = ''; $value = '';