From 229c036d59c768bceb1b15c8d9f612f4e0c4f209 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 20 Jan 2009 23:12:04 +0000 Subject: [PATCH] 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 --- javascript/LeftAndMain_right.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/LeftAndMain_right.js b/javascript/LeftAndMain_right.js index 1474ba61..43389f48 100755 --- a/javascript/LeftAndMain_right.js +++ b/javascript/LeftAndMain_right.js @@ -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; }