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
5c8860f735
commit
db23afadac
@@ -21,6 +21,11 @@ YUI.add('moodle-core-formchangechecker',
|
||||
initializer : function(config) {
|
||||
var formid = 'form#' + this.get('formid');
|
||||
|
||||
if (!currentform) {
|
||||
// If the form was not found, then we can't check for changes.
|
||||
return;
|
||||
}
|
||||
|
||||
// Add change events to the form elements
|
||||
var currentform = Y.one(formid);
|
||||
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'input', this);
|
||||
|
||||
Reference in New Issue
Block a user