1

Closed

userToJsonObject userId broken in 2013.0.1

description

There's a typo in this function that prevents returning of a valid userId.
thisUser.Id should be thisUser.id instead.
function userToJsonObject(s) {
        if (s.length === 0) {
            return null;
        } else {
            var thisUser = new SplitIndex(s); 
            var thisUserExpanded = thisUser.value.split(",#");
            if(thisUserExpanded.length === 1) {
                return {userId: thisUser.Id, userName: thisUser.value};
            } else {
                return {
                    // SplitIndex(s) returns obj.id not obj.Id
                    // userId: thisUser.Id, 
                    userId: thisUser.id,
                    userName: thisUserExpanded[0].replace( /(,,)/g, ","), 
                    loginName: thisUserExpanded[1].replace( /(,,)/g, ","), 
                    email: thisUserExpanded[2].replace( /(,,)/g, ","), 
                    sipAddress: thisUserExpanded[3].replace( /(,,)/g, ","), 
                    title: thisUserExpanded[4].replace( /(,,)/g, ",")
                };
            }
        }
    }
Closed Dec 28, 2013 at 6:49 PM by sympmarc
Released in 2013.02

comments

sympmarc wrote May 16, 2013 at 6:24 PM

Thanks, Rainer. Fixed in 2010.02ALPHA1