This commit is contained in:
Huong Nguyen
2026-03-23 13:36:51 +07:00
+6 -3
View File
@@ -3707,12 +3707,15 @@ class admin_setting_configmultiselect extends admin_setting_configselect {
if (!is_array($data)) {
return ''; //ignore it
}
if (!$this->load_choices() or empty($this->choices)) {
return '';
}
unset($data['xxxxx']);
// Only reject when the caller actually supplied a value
// and there is no valid choices to validate against.
if (!empty($data) && (!$this->load_choices() || empty($this->choices))) {
return '';
}
$save = array();
foreach ($data as $value) {
if (!array_key_exists($value, $this->choices)) {