fix javascript error caused by caching using a string context, searching now for a nextmatch one

This commit is contained in:
Ralf Becker 2014-09-08 14:59:19 +00:00
parent f157e4f56c
commit 414eeec511

View File

@ -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;
}