Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-38356 Forms: Check that the form exists before applying changeche…

…cker

Signed-off-by: Andrew Robert Nicols <andrew.nicols@luns.net.uk>
  • Loading branch information...
commit 057f509fad892e8f9bd9d63ac4be5f1a2ae14198 1 parent 19075a2
@brentboghosian brentboghosian authored andrewnicols committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/yui/formchangechecker/formchangechecker.js
View
5 lib/yui/formchangechecker/formchangechecker.js
@@ -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);

0 comments on commit 057f509

Please sign in to comment.
Something went wrong with that request. Please try again.