From bae72d873461291b9460a8a600bb5a4f0a698924 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 8 Sep 2014 15:54:35 +0000 Subject: [PATCH] fix javascript error caused by caching using a string context, searching now for a nextmatch one --- phpgwapi/js/jsapi/egw_data.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/phpgwapi/js/jsapi/egw_data.js b/phpgwapi/js/jsapi/egw_data.js index 199304362c..9470e25bf9 100644 --- a/phpgwapi/js/jsapi/egw_data.js +++ b/phpgwapi/js/jsapi/egw_data.js @@ -811,9 +811,22 @@ egw.extend("data_storage", egw.MODULE_GLOBAL, function (_app, _wnd) { }; uid = uid.join("::"); + // find filters, even if context is not always from nextmatch, eg. caching uses it's a string context + var filters = {}; + for(var i=0; i < registeredCallbacks[_uid].length; i++) + { + var callback = registeredCallbacks[_uid][i]; + if (typeof callback.context == 'object' && + typeof callback.context.self == 'object' && + typeof callback.context.self._filters == 'object') + { + filters = callback.context.self._filters; + break; + } + } + // need to send nextmatch filters too, as server-side will merge old version from request otherwise - this.dataFetch(_execId, {'refresh':uid}, registeredCallbacks[_uid][0].context.self._filters || {}, - nextmatchId, false, context, [uid]); + this.dataFetch(_execId, {'refresh':uid}, filters, nextmatchId, false, context, [uid]); return true; }