Ignore:
Timestamp:
2023-09-27T19:35:57+13:00 (8 months ago)
Author:
anupama
Message:

The ajax errorResponse function wasn't being called on perl's gsdl_cgi->generate_error(). So a silent die call would happen that wasn't being noticed. The ajax successResponseFunction now checks for the ERROR: message generated by gsdl_CGI generate_error() and the JavaScript error handler is now thus called anyway. But I'm not sure this is the right way to handle it? What about all the other ajax calls where the errorResponse function isn't called?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/user_comments.js

    r38234 r38237  
    461461    var result = (data.responseText) ? data.responseText : data;       
    462462
     463    // check for gsdl_cgi->generate_error() result, which ends up in a silent die statement
     464    // unless we look for it in the "success" result, in the form of a message starting
     465    // with "ERROR:"   
     466    if(result.indexOf("ERROR: ") !== -1 || result.indexOf("<Error>") !== -1) {
     467    gs.usercomments.removeMultipleCommentsFailed(data);
     468    return;
     469    }
     470   
    463471    //console.log("@@@ Done removing metadata:\n" + result);
    464472   
Note: See TracChangeset for help on using the changeset viewer.