Ignore:
Timestamp:
2013-05-01T15:24:42+12:00 (11 years ago)
Author:
ak19
Message:

When retrieving a collection's existing usercomments, the collection could be open in GLI and therefore locked so that the metadata retrieve fails with an error about this. The while loop in the loadUserComments javascript function needs error handling therefore, since the page load hangs otherwise during the meta retrieve loop as things seem to be retrieving something (an error) instead of meta and the loop keeps going.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/style.dm

    r27281 r27282  
    281281    // Store each triplet in the comments array. Stop when there's no further usernames in archives
    282282
    283     while(username) \{
     283    while(username) \{  //&& !username.indexOf("ERROR") == -1) \{
     284   
     285        var errorIndex = username.indexOf("ERROR");
     286        if(errorIndex != -1) \{
     287           var endIndex = username.indexOf("(");
     288           var error = username.substring(errorIndex,endIndex);
     289           var errormessage=document.createTextNode("Error retrieving comments. " + error);
     290           usercommentdiv.appendChild(errormessage);
     291           //alert(username);
     292           break;
     293        \}
    284294   
    285295        timestamp = gsapi.getArchivesMetadata(doc_id, "usertimestamp", metapos);
Note: See TracChangeset for help on using the changeset viewer.