From 41977bb4cc75fe82b917df1935a826f2cc6b4bc0 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 12 Aug 2011 19:11:45 +0100 Subject: [PATCH] MDL-28737 advcheckboxes toggle state every submit if checkbox_controller present. --- lib/formslib.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/formslib.php b/lib/formslib.php index 16d934aaf79..3962debe9f5 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -980,15 +980,6 @@ abstract class moodleform { $mform->setType("checkbox_controller$groupid", PARAM_INT); $mform->setConstants(array("checkbox_controller$groupid" => $new_select_value)); - // Locate all checkboxes for this group and set their value, IF the optional param was given - if (!is_null($select_value)) { - foreach ($this->_form->_elements as $element) { - if ($element->getAttribute('class') == "checkboxgroup$groupid") { - $mform->setConstants(array($element->getAttribute('name') => $select_value)); - } - } - } - $checkbox_controller_name = 'nosubmit_checkbox_controller' . $groupid; $mform->registerNoSubmitButton($checkbox_controller_name); @@ -997,7 +988,7 @@ abstract class moodleform { if (!defined('HTML_QUICKFORM_CHECKBOXCONTROLLER_EXISTS')) { $js .= <<