silverstripe/silverstripe-cms — pull request #242 by chillu (2012-11-21 12:39:40+00:00)
Title: BUG Consistently use FormResponse in CMS JavaScript (fixes #8036)

See http://open.silverstripe.org/ticket/8036

Regression caused by a security fix in 9bf3ae9a190. The whole point of that change was to set the content-type to 'text/json', so we can't revert it without re-introducing the security hole.
But this also meant that `Ajax.Evaluator` was triggered twice: Once in the (hacked up) prototype.js global ajax handling, and once through the various `onSuccess` callbacks on individual ajax requests.
So we're not dealing with two ajax responses, the same response is eval'ed twice.

I've fixed this by removing all those individual calls to `Ajax.Evaluator`,
and consistently using `FormResponse` to return content (some UIs used `echo`).

This change has some potential to further break CMS behaviour.
I've tested each altered feature (adding and batch-deleting pages/files/folders, reverting a page to live, creating a translation, handling comments in CommentAdmin, submitting a new comment on the website, etc). - would feel better if somebody else could do a sanity check though.

@sminnee @hafriedlander So this warrants a 2.4.9 release, correct?