-
Bug
-
Resolution: Fixed
-
Minor
-
2.3.5, 2.4.2, 2.5
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_23_STABLE, MOODLE_24_STABLE
-
Frozen forms cause javascript error: currentform is null
- this is due to fact that no form tag is present for frozen forms, but code in /lib/yui/formchangechecker/formchangechecker.js::init() assumes form present.
Suggested code fix:--- a/lib/yui/formchangechecker/formchangechecker.js
+++ b/lib/yui/formchangechecker/formchangechecker.js
@@ -23,6 +23,11 @@ YUI.add('moodle-core-formchangechecker',
// Add change events to the form elements
var currentform = Y.one(formid);
+ if (!currentform) {
+ return;
+ }
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'input', this);
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'textarea', this);
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'select', this);