From e103145a5335479e9c6af45ca9f0215257581527 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 22 Jan 2014 09:30:22 +0000 Subject: [PATCH] Fix JSON to call callback even if server does not return anything in particular. --- phpgwapi/js/jsapi/egw_json.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/js/jsapi/egw_json.js b/phpgwapi/js/jsapi/egw_json.js index 978594826f..c1fdc4c4d9 100644 --- a/phpgwapi/js/jsapi/egw_json.js +++ b/phpgwapi/js/jsapi/egw_json.js @@ -105,7 +105,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) { } json_request.prototype.handleResponse = function(data) { - if (data && data.response) + if (data && typeof data.response != 'undefined') { // Load files first var js_files = []; @@ -132,7 +132,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) { } // Flag for only data response - don't call callback if only data - var only_data = true; + var only_data = (data.response.length > 0); for (var i = 0; i < data.response.length; i++) {