diff --git a/phpgwapi/js/jsapi/egw_debug.js b/phpgwapi/js/jsapi/egw_debug.js index 94b241ef66..1552ec21e8 100644 --- a/phpgwapi/js/jsapi/egw_debug.js +++ b/phpgwapi/js/jsapi/egw_debug.js @@ -139,13 +139,18 @@ egw.extend('debug', egw.MODULE_GLOBAL, function(_app, _wnd) { if (window.localStorage && typeof window.localStorage[LASTLOG] != 'undefined') { var lastlog = parseInt(window.localStorage[LASTLOG]); - for(var i=lastlog; i < MAX_LOGS && typeof window.localStorage[LOG_PREFIX+i] != 'undefined'; ++i) + for(var i=lastlog; i < lastlog+MAX_LOGS; ++i) { - logs.push(JSON.parse(window.localStorage[LOG_PREFIX+i])); - } - for (var i=0; i < lastlog; ++i) - { - logs.push(JSON.parse(window.localStorage[LOG_PREFIX+i])); + var log = window.localStorage[LOG_PREFIX+(i%MAX_LOGS)]; + if (typeof log != 'undefined') + { + try { + logs.push(JSON.parse(log)); + } + catch(e) { + // ignore not existing log entries + } + } } } return logs; diff --git a/phpgwapi/js/jsapi/jsapi.js b/phpgwapi/js/jsapi/jsapi.js index 1b7fbe3b3b..dbfd19a850 100644 --- a/phpgwapi/js/jsapi/jsapi.js +++ b/phpgwapi/js/jsapi/jsapi.js @@ -228,8 +228,8 @@ function egw_getAppName() function egw_refresh(_msg, _app, _id, _type, _targetapp, _replace, _with, _msg_type) { // Log for debugging purposes - egw.debug("log", "egw_refresh(%s, %s, %s, %o, %s, %s)",_msg,_app,_id,_type,_target_app,_replace,_with,_msg_type); - + egw.debug("log", "egw_refresh(%s, %s, %s, %o, %s, %s)", _msg, _app, _id, _type, _targetapp, _replace, _with, _msg_type); + //alert("egw_refresh(\'"+_msg+"\',\'"+_app+"\',\'"+_id+"\',\'"+_type+"\')"); var win = typeof _targetapp != 'undefined' ? egw_appWindow(_targetapp) : window;