From bae2432219581deb65234e5fa8fa4c96a9dcedd5 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 2 Aug 2009 11:37:37 +0000 Subject: [PATCH] MDL-19982 fixed notice if group empty; merged from MOODLE_19_STABLE --- lib/form/selectgroups.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/form/selectgroups.php b/lib/form/selectgroups.php index 8cb0539cbd0..733b4154020 100644 --- a/lib/form/selectgroups.php +++ b/lib/form/selectgroups.php @@ -499,6 +499,9 @@ class MoodleQuickForm_selectgroups extends HTML_QuickForm_element { $cleanValue = null; foreach ($value as $v) { foreach ($this->_optGroups as $optGroup){ + if (empty($optGroup['options'])) { + continue; + } for ($i = 0, $optCount = count($optGroup['options']); $i < $optCount; $i++) { if ($v == $optGroup['options'][$i]['attr']['value']) { $cleanValue[] = $v;