Ignore:
Timestamp:
07/01/09 07:32:59 (16 years ago)
Author:
lgiessmann
Message:

ajax-client: fixed a bug which occured by editing existing topics with more than one PSI - if you selected the placeholder "current-topic" the PSIs were transformed to JSON as one long string and not as an array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/ajax/javascripts/create.js

    r80 r83  
    134134        // --- if the validation succeeded the fragment will be sent to the server
    135135        var tPsis = topic.getContent().subjectIdentifiers;
     136        if(!tPsis || tPsis.length === 0) tPsis = "null";
     137        else tPsis = tPsis.toJSON()
    136138        var referencedTopics = topic.getReferencedTopics();
    137139        if(associations){
     
    150152            var jTopic = "\"topic\":" + topic.toJSON();
    151153            var jTopicStubs = "\"topicStubs\":" + tsStr;
    152             var jAssociations = "\"associations\":" + (associations ? associations.toJSON().gsub(CURRENT_TOPIC_ESCAPED, tPsis) : "null");
     154            var jAssociations = "\"associations\":" + (associations ? associations.toJSON().gsub("\\[\"" + CURRENT_TOPIC_ESCAPED + "\"\\]", tPsis) : "null");
    153155            var jTmId = "\"tmIds\":" + tmId.toJSON();
    154156            var json = "{" + jTopic + "," + jTopicStubs + "," + jAssociations + "," + jTmId + "}";
Note: See TracChangeset for help on using the changeset viewer.