BUGFIX If __form.elements.ID is not defined, don't cause an error in the CMS under certain circumstances

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@70481 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-20 23:12:04 +00:00 committed by Sam Minnee
parent c2b5cdbc64
commit 229c036d59

View File

@ -163,7 +163,7 @@ CMSForm.prototype = {
var __callAfter = callAfter;
var __form = this;
if(__form.notify) __form.notify('BeforeSave', __form.elements.ID.value);
if(__form.notify && __form.elements.ID != undefined) __form.notify('BeforeSave', __form.elements.ID.value);
// validate if required
if(this.validate && !this.validate()) {
@ -179,7 +179,7 @@ CMSForm.prototype = {
Ajax.Evaluator(response);
__form.resetElements();
if(__callAfter) __callAfter();
if(__form.notify) __form.notify('PageSaved', __form.elements.ID.value);
if(__form.notify && __form.elements.ID != undefined) __form.notify('PageSaved', __form.elements.ID.value);
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
_AJAX_LOADING = false;
}