SPRedirectWithID in 2013.01 Failing on Line 2711

Jun 20, 2013 at 7:37 PM
I tried upgrading to SPServices 2013.01 from 0.7.1a. I noticed my SPRedirectWithID quit functioning. I looked at the source and noticed that the final line of the function has changed.

Line 2711:
location.href = thisRedirectUrl +
     (thisRedirectUrl.indexOf("?") > 0) ? "&" : "?" +
     opt.qsParamName + "=" + lastID +
    ((typeof queryStringVals.RealSource === "string") ? ("&Source=" + queryStringVals.RealSource) : "");
Notice is starts with thisRedirectUrl then appends it based on conditions. In my case, my original thisRedirectUrl up to that point is "../../pages/NewTORedirect.aspx" and when line 2711 runs, location.href results in "&"

I ran a simple test as...
var thisRedirectUrl = "../../pages/NewTORedirect.aspx";
var strLocation = thisRedirectUrl + (thisRedirectUrl.indexOf("?") > 0) ? "&" : "?TOID=598";
console.log(strLocation );
Reasonably, you would expect my output to be...
"../../pages/NewTORedirect.aspx?TOID=598"
but instead, I get...
"&"

I then ran the test as...
var thisRedirectUrl = "../../pages/NewTORedirect.aspx";
var strLocation = (thisRedirectUrl.indexOf("?") > 0) ? "&" : "?TOID=598";
console.log(strLocation );
Notice, I'm not appending thisRedirectUrl this time. My output was (correctly)...
"?TOID=598"

I'm running IE8, MOSS 2007, SPServices 2013.01, and jQuery 1.8.3. Is there something wrong with the syntax in line 2711 that I'm missing?
Oct 29, 2013 at 1:15 PM
Edited Oct 29, 2013 at 1:18 PM
Hi gkoliver,

I originally had my fix in this post, but then I just saw that this issue has already been discussed in the following issue:
https://spservices.codeplex.com/workitem/10162
Coordinator
Oct 29, 2013 at 1:17 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Oct 29, 2013 at 1:18 PM
Sorry I missed this post, gkoliver. I've added it to the list for 2013.02.

M.