Fixed bug #10067: common.js uses undefined variable
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 12 Jan 2009 13:12:59 +0000 (13:12 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 12 Jan 2009 13:12:59 +0000 (13:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4697 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/js/common.js

index ad9f43b..5bd28e3 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Fixed bug #10065: Use TYPO3 clear.gif for ExtJS in backend.php
        * Fixed bug #10066: AJAX relogin polls server too often
+       * Fixed bug #10067: common.js uses undefined variable
 
 2009-01-11  Oliver Hader  <oliver@typo3.org>
 
index 1678b7c..8da8556 100644 (file)
@@ -41,7 +41,7 @@ if (Prototype) {
                        if (origSuccess) {
                                request.options.onSuccess = function(xhr, json) {
                                        if (!json) {
-                                               T3AJAX.showError(xhr, json);    
+                                               T3AJAX.showError(xhr);
                                        } else {
                                                origSuccess(xhr, json);
                                        }
@@ -54,7 +54,7 @@ if (Prototype) {
                                        if (!json && request.options.onT3Error) {
                                                request.options.onT3Error(xhr, json);
                                        } else if (!json) {
-                                               T3AJAX.showError(xhr, json);
+                                               T3AJAX.showError(xhr);
                                        } else {
                                                origComplete(xhr, json);
                                        }
@@ -66,5 +66,12 @@ if (Prototype) {
 
 var T3AJAX = new Object();
 T3AJAX.showError = function(xhr, json) {
-       alert(xhr.responseText);
+       if (typeof xhr.responseText != 'undefined' && xhr.responseText) {
+               if (typeof Ext.MessageBox != 'undefined') {
+                       Ext.MessageBox.alert('TYPO3', xhr.responseText);
+               }
+               else {
+                       alert(xhr.responseText);
+               }
+       }
 }