silverstripe/sapphire — pull request #683 by tractorcow (2012-07-30 22:29:26+00:00)
Title: FIXED: Issue where ajax urls had incorrect querystring arguments

In LeftAndMain.Tree.js the ajax url pulled from the data attribute "data-url-updatetreenodes" would have the parameter "ids" appended onto the end. However, if this url already contained the question mark character an additional character would be appended, generating a malformed url.

This can be replicated by using the translatable module, where the locale parameter is usually set already, and creating a new page in the CMS.

The fix (check commits) adds an additional check to the url generation code to correctly handle these cases.

E.g. url?locale=en_nz?ids=42 now becomes url?locale=en_nz&ids=42

There are probably other areas around the code in which this behaviour is still incorrect.