diff --git a/common/js/xml_handler.js b/common/js/xml_handler.js index 24207788a..7495dbd93 100644 --- a/common/js/xml_handler.js +++ b/common/js/xml_handler.js @@ -241,11 +241,12 @@ // If the response contains an error, display the error message. if(data.error != "0" && data.error > -1000) { + // Should not display the error message when the callback function returns false. + if ($.isFunction(callback_error) && callback_error(data) === false) { + return; + } if(data.error == -1 && data.message == "admin.msg_is_not_administrator") { alert("You are not logged in as an administrator."); - if ($.isFunction(callback_error)) { - callback_error(data); - } return; } else { if (data.message) { @@ -253,9 +254,6 @@ } else { alert("AJAX communication error while requesting " + request_info); } - if ($.isFunction(callback_error)) { - callback_error(data); - } return; } }