mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
c2b5cdbc64
commit
229c036d59
@ -163,7 +163,7 @@ CMSForm.prototype = {
|
|||||||
var __callAfter = callAfter;
|
var __callAfter = callAfter;
|
||||||
var __form = this;
|
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
|
// validate if required
|
||||||
if(this.validate && !this.validate()) {
|
if(this.validate && !this.validate()) {
|
||||||
@ -179,7 +179,7 @@ CMSForm.prototype = {
|
|||||||
Ajax.Evaluator(response);
|
Ajax.Evaluator(response);
|
||||||
__form.resetElements();
|
__form.resetElements();
|
||||||
if(__callAfter) __callAfter();
|
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();
|
if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading();
|
||||||
_AJAX_LOADING = false;
|
_AJAX_LOADING = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user