From: skodak Date: Fri, 24 Apr 2009 07:15:45 +0000 (+0000) Subject: MDL-18948 fixed handling of indexes when removing options; merged from MOODLE_19_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=29712788b7ad5e6d700447bc3c9c5b51b1a6dfb2;p=moodle.git MDL-18948 fixed handling of indexes when removing options; merged from MOODLE_19_STABLE --- diff --git a/lib/form/select.php b/lib/form/select.php index 95a1fb4fe4..6dfff5fede 100644 --- a/lib/form/select.php +++ b/lib/form/select.php @@ -92,6 +92,8 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{ foreach ($this->_options as $key=>$option){ if ($option['attr']['value']==$value){ unset($this->_options[$key]); + // we must reindex the options because the ugly code in quickforms' select.php expects that keys are 0,1,2,3... !?!? + $this->_options = array_merge($this->_options); return; } }