From: skodak Date: Sun, 8 Jul 2007 21:31:14 +0000 (+0000) Subject: MDL-10382 Allow removing of elements with disabledIf conditions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=854386bc047072741adced273d80a4c3480eb2e1;p=moodle.git MDL-10382 Allow removing of elements with disabledIf conditions --- diff --git a/lib/formslib.php b/lib/formslib.php index bd03590cc5..44ee8c01a6 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1219,6 +1219,9 @@ function validate_' . $this->_formName . '(frm) { $js .= "var $iname = Array();\n"; foreach ($this->_dependencies as $dependentOn => $conditions){ + if (!$this->elementExists($dependentOn)) { + continue; + } $js .= "{$iname}['$dependentOn'] = Array();\n"; foreach ($conditions as $condition=>$values) { $js .= "{$iname}['$dependentOn']['$condition'] = Array();\n";