-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
2.2, 2.3
-
MOODLE_22_STABLE, MOODLE_23_STABLE
Multiple disableIf depending on the same element does not work well in Moodle 2.2 (it's fine in Moodle 2.1)
For example, assuming that I have a select box and a textbox
$mform->addElement('select', 'select1', get_string('...', '...'), array(1, 2, 3, 4));
|
$mform->addElement('text', 'text1', get_string('...', '...')_;
|
I'd like to disable the text when select = 1 or 2
$mform->disabledIf('text1', 'select1', 'eq', 1);
|
$mform->disabledIf('text1', 'select1', 'eq', 2);
|
In Moodle 2.2, just the first disabledIf command works. The second one is "hidden" by the first. Some debugging led me to the function convert_to_array in moodle_lib.php, the in_array condition eliminate the second rule so it doesn't appear in the json object passed to the javascript:
Problem(s) described here: http://moodle.org/mod/forum/discuss.php?d=207045