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

This commit is contained in:
Paul Holden
2024-01-17 08:55:48 +00:00
parent 580c009cac
commit b2da42527a
@@ -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) {