MDL-38356 Forms: Check that the form exists before applying changechecker
Signed-off-by: Andrew Robert Nicols <[email protected]>
This commit is contained in:
committed by
Andrew Robert Nicols
parent
cce0d9a100
commit
7e21ee683b
@@ -18,6 +18,11 @@ YUI.add('moodle-core-formchangechecker',
|
||||
var formid = 'form#' + this.get('formid'),
|
||||
currentform = Y.one(formid);
|
||||
|
||||
if (!currentform) {
|
||||
// If the form was not found, then we can't check for changes.
|
||||
return;
|
||||
}
|
||||
|
||||
// Add change events to the form elements
|
||||
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'input', this);
|
||||
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'textarea', this);
|
||||
|
||||
Reference in New Issue
Block a user