[BUGFIX] Correct access of AJAX response in t3editor 35/38635/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 11 Apr 2015 09:42:28 +0000 (11:42 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Sun, 12 Apr 2015 14:51:46 +0000 (16:51 +0200)
Due to an update of prototype.js, the AJAX response has changed.
Use the correct response object to determine if saving was successful.

Resolves: #66380
Releases: master
Change-Id: I303d90e4cd80ee6164e26ad60d0ac3a1f5fe49c5
Reviewed-on: http://review.typo3.org/38635
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/t3editor/res/jslib/t3editor.js

index cd795f5..79b3523 100644 (file)
@@ -323,9 +323,8 @@ if (!Prototype.Browser.MobileSafari) {
                                                        TYPO3.settings.ajaxUrls['T3Editor::saveCode'], {
                                                                parameters: params,
                                                                onComplete: function(ajaxrequest) {
-                                                                       var wasSuccessful = ajaxrequest.status == 200
-                                                                       && ajaxrequest.headerJSON.result == true;
-                                                                       event.memo.t3editor.saveFunctionComplete(wasSuccessful,ajaxrequest.headerJSON);
+                                                                       var wasSuccessful = ajaxrequest.status === 200 && ajaxrequest.responseJSON.result === true;
+                                                                       event.memo.t3editor.saveFunctionComplete(wasSuccessful,ajaxrequest.responseJSON);
                                                                }
                                                        }
                                                );