From 854386bc047072741adced273d80a4c3480eb2e1 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 8 Jul 2007 21:31:14 +0000 Subject: [PATCH] MDL-10382 Allow removing of elements with disabledIf conditions --- lib/formslib.php | 3 +++ 1 file changed, 3 insertions(+) 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"; -- 2.39.5