From d2945ce3b0c56882fade46173e2dd74938325cf1 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 8 Jan 2015 14:27:35 +0000 Subject: [PATCH] Return clone of preference object as we don't want direct reference to original object --- phpgwapi/js/jsapi/egw_message.js | 2 +- phpgwapi/js/jsapi/egw_preferences.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpgwapi/js/jsapi/egw_message.js b/phpgwapi/js/jsapi/egw_message.js index f9e313f7df..4af71ef1f0 100644 --- a/phpgwapi/js/jsapi/egw_message.js +++ b/phpgwapi/js/jsapi/egw_message.js @@ -256,7 +256,7 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd) win.app_refresh(_msg, _app, _id, _type); return; } - + // etemplate2 specific to avoid reloading whole page if(typeof win.etemplate2 != "undefined" && win.etemplate2.app_refresh) { diff --git a/phpgwapi/js/jsapi/egw_preferences.js b/phpgwapi/js/jsapi/egw_preferences.js index 47cebecb11..d0da815bd5 100644 --- a/phpgwapi/js/jsapi/egw_preferences.js +++ b/phpgwapi/js/jsapi/egw_preferences.js @@ -66,9 +66,9 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function() { request.sendRequest(false, 'GET'); // use synchronous (cachable) GET request if (typeof prefs[_app] == 'undefined') prefs[_app] = {}; } - if(_name == "*") return prefs[_app]; + if(_name == "*") return typeof prefs[_app] ==='object'?jQuery.extend({},prefs[_app]):prefs[_app]; - return prefs[_app][_name]; + return typeof prefs[_app][_name] ==='object'?jQuery.extend({},prefs[_app][_name]):prefs[_app][_name]; }, /**