mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
MDL-57209 forms: Notice: Undefined index: options in profile edit page
Skipping a loop iteration if the option group has no options.
This commit is contained in:
parent
a0352aa95e
commit
f6f0cb49aa
@ -376,6 +376,9 @@ class MoodleQuickForm_selectgroups extends HTML_QuickForm_element implements tem
|
||||
if (is_array($this->_values)) {
|
||||
foreach ($this->_values as $key => $val) {
|
||||
foreach ($this->_optGroups as $optGroup) {
|
||||
if (empty($optGroup['options'])) {
|
||||
continue;
|
||||
}
|
||||
for ($i = 0, $optCount = count($optGroup['options']); $i < $optCount; $i++) {
|
||||
if ((string)$val == (string)$optGroup['options'][$i]['attr']['value']) {
|
||||
$value[$key] = $optGroup['options'][$i]['text'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user