From f60fa14c30a7eb031b40639ea7f6cf60b61244ed Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Sat, 20 Jul 2013 13:54:31 +0000 Subject: [PATCH] Wrap loadingFinished() in a try / catch, so if one widget has problems it doesn't break the whole template. --- etemplate/js/et2_core_widget.js | 9 ++++++++- etemplate/js/et2_widget_dialog.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_core_widget.js b/etemplate/js/et2_core_widget.js index 2706e05629..d848342587 100644 --- a/etemplate/js/et2_core_widget.js +++ b/etemplate/js/et2_core_widget.js @@ -733,7 +733,14 @@ var et2_widget = Class.extend( // Descend recursively into the tree for (var i = 0; i < this._children.length; i++) { - this._children[i].loadingFinished(); + try + { + this._children[i].loadingFinished(); + } + catch (e) + { + egw.debug("error", "There was an error with a widget:\nError:%s\nProblem widget:%o",e.message,this._children[i]); + } } } }, diff --git a/etemplate/js/et2_widget_dialog.js b/etemplate/js/et2_widget_dialog.js index 8ecc9dab52..9b9b0f20d7 100644 --- a/etemplate/js/et2_widget_dialog.js +++ b/etemplate/js/et2_widget_dialog.js @@ -334,7 +334,7 @@ var et2_dialog = et2_widget.extend({ } // If dialog already created, update buttons - if(this.div.data('uiDialog')) + if(this.div.data('ui-dialog')) { this.div.dialog("option", "buttons", buttons);