MDL-78417 tool_uploaduser: handle empty default in custom menu field.

This commit is contained in:
Paul Holden
2024-01-17 08:55:54 +00:00
parent 076379a485
commit 4d0d8f7f1b
@@ -367,6 +367,11 @@ class cli_helper {
$firstoption = reset($selectoptions);
$default = $firstoption['attr']['value'];
}
// The menu profile field type allows for an empty default value, handle that here.
if (preg_match('/^profile_field_/', $name) && $default === '') {
$possiblevalues[] = $default;
}
}
if ($element instanceof \HTML_QuickForm_checkbox) {