From 7c77033fb6234ce225744b045e1a2d7e4e92bbf3 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 23 Apr 2007 16:19:25 +0000 Subject: [PATCH] MDL-9524 - Formslib gets confused if a required field is frozen. Merged from MOODLE_18_STABLE. --- lib/formslib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/formslib.php b/lib/formslib.php index baf928c863..603cfb725c 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1056,6 +1056,11 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { } } } + + // Fix for MDL-9524. If you don't do this, then $element may be left as a reference to one of the fields in + // the form, and then that form field gets corrupted by the code that follows. + unset($element); + $js = '