AuthGroupField select "none" when empty string is provided

This commit is contained in:
Ad Schellevis 2017-02-07 15:55:44 +01:00
parent f44a60f9b0
commit 324bd7555d

View File

@ -93,7 +93,7 @@ class AuthGroupField extends BaseField
$result = array ();
// if certificate is not required, add empty option
if (!$this->internalIsRequired) {
$result[""] = array("value" => gettext("none"), "selected" => 0);
$result[""] = array("value" => gettext("none"), "selected" => ($this->internalValue == "") ? 1 : 0);
}
$groups = explode(',', $this->internalValue);
@ -129,4 +129,4 @@ class AuthGroupField extends BaseField
}
return $validators;
}
}
}