[TASK] Do not crash install tool if a modal fails 50/58350/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 20 Sep 2018 13:09:16 +0000 (15:09 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 20 Sep 2018 15:56:37 +0000 (17:56 +0200)
* Direct action buttons (eg. clear cache) catch ajax errors
  and turn them into a notification, so the main frame of
  the install tool does not die.
* Server side errors triggered by ajax calls from within
  modals no longer kill the main install tool frame, but
  render the error message into the modal.
* Improved error display with more info on how to recover
  and a (collapsed) output of the generic server side
  error message or backtrace depending on error settings.

Resolves: #86330
Releases: master
Change-Id: I9fa7602d0ea26d979f832022e03b78975b9877af
Reviewed-on: https://review.typo3.org/58350
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
28 files changed:
typo3/sysext/install/Resources/Public/JavaScript/Modules/Cache.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ChangeInstallToolPassword.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ClearTables.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ClearTypo3tempFiles.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/CoreUpdate.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/CreateAdmin.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/DatabaseAnalyzer.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/DumpAutoload.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/EnvironmentCheck.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ExtensionCompatTester.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ExtensionConfiguration.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ExtensionScanner.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/Features.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/FolderStructure.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ImageProcessing.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/LanguagePacks.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/LocalConfiguration.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/MailTest.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/PhpInfo.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/Presets.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/ResetBackendUserUc.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/Router.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/SystemInformation.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/SystemMaintainer.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/TcaExtTablesCheck.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/TcaMigrationsCheck.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/UpgradeDocs.js
typo3/sysext/install/Resources/Public/JavaScript/Modules/UpgradeWizards.js

index 3b105dc..498a61f 100644 (file)
@@ -42,7 +42,11 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          // In case the clear cache action fails (typically 500 from server), do not kill the entire
+          // install tool, instead show a notification that something went wrong.
+          Notification.error(
+            'Clearing caches went wrong on the server side. Check the system for broken extensions or missing database tables and try again'
+          );
         },
         complete: function() {
           $trigger.removeClass('disabled');
index f500596..1295714 100644 (file)
@@ -33,7 +33,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getData();
+      this.getData();
 
       currentModal.on('click', this.selectorChangeTrigger, function(e) {
         e.preventDefault();
@@ -45,8 +45,7 @@ define([
     },
 
     getData: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('changeInstallToolPasswordGetData'),
         cache: false,
@@ -58,14 +57,15 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     change: function() {
       var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('install-tool-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('install-tool-token');
       $.ajax({
         url: Router.getUrl(),
         method: 'POST',
@@ -88,7 +88,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         },
         complete: function() {
           self.currentModal.find('.t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check').val('')
index f3e7617..360625c 100644 (file)
@@ -42,7 +42,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getStats();
+      this.getStats();
 
       currentModal.on('click', this.selectorStatsTrigger, function(e) {
         e.preventDefault();
@@ -59,7 +59,7 @@ define([
 
     getStats: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('clearTablesStats'),
         cache: false,
@@ -83,14 +83,14 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     clear: function(table) {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('clear-tables-clear-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('clear-tables-clear-token');
       $.ajax({
         url: Router.getUrl(),
         method: 'POST',
@@ -114,7 +114,7 @@ define([
           this.getStats();
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index 19c8d2d..e863135 100644 (file)
@@ -43,7 +43,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getStats();
+      this.getStats();
 
       currentModal.on('click', this.selectorStatsTrigger, function(e) {
         e.preventDefault();
@@ -60,7 +60,7 @@ define([
 
     getStats: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('clearTypo3tempFilesStats'),
         cache: false,
@@ -84,14 +84,14 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     delete: function(folder, storageUid) {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('clear-typo3temp-delete-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('clear-typo3temp-delete-token');
       $.ajax({
         method: 'POST',
         url: Router.getUrl(),
@@ -116,7 +116,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index e177fa8..2b0a454 100644 (file)
@@ -85,9 +85,9 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getData();
+      this.getData();
 
-      var buttonTemplateSection = $(self.selectorTemplate);
+      var buttonTemplateSection = $(this.selectorTemplate);
       this.buttonTemplate = buttonTemplateSection.children().clone();
 
       $(document).on('click', '.t3js-coreUpdate-init', function(e) {
@@ -99,8 +99,7 @@ define([
     },
 
     getData: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('coreUpdateGetData'),
         cache: false,
@@ -112,7 +111,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
@@ -188,6 +187,7 @@ define([
      */
     handleResult: function(data, successMessage) {
       var canContinue = false;
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       this.removeLoadingMessage();
       if (data.success === true) {
         canContinue = true;
@@ -201,7 +201,7 @@ define([
           this.addMessage(Severity.ok, successMessage);
         }
       } else {
-        Router.handleAjaxError(xhr);
+        Router.handleAjaxError(xhr, modalContent);
       }
       return canContinue;
     },
index 1160a1b..c6bd6e0 100644 (file)
@@ -35,9 +35,8 @@ define([
     currentModal: {},
 
     initialize: function(currentModal) {
-      var self = this;
       this.currentModal = currentModal;
-      self.getData();
+      this.getData();
 
       currentModal.on('click', this.selectorCreateTrigger, function(e) {
         e.preventDefault();
@@ -50,8 +49,7 @@ define([
     },
 
     getData: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('createAdminGetData'),
         cache: false,
@@ -63,14 +61,15 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     create: function() {
       var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('create-admin-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('create-admin-token');
       $.ajax({
         url: Router.getUrl(),
         method: 'POST',
@@ -100,13 +99,13 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
-      self.currentModal.find('.t3js-createAdmin-user').val('');
-      self.currentModal.find('.t3js-createAdmin-password').val('');
-      self.currentModal.find('.t3js-createAdmin-password-check').val('');
-      self.currentModal.find('.t3js-createAdmin-system-maintainer').prop('checked', false);
+      this.currentModal.find('.t3js-createAdmin-user').val('');
+      this.currentModal.find('.t3js-createAdmin-password').val('');
+      this.currentModal.find('.t3js-createAdmin-password-check').val('');
+      this.currentModal.find('.t3js-createAdmin-system-maintainer').prop('checked', false);
     }
   };
 });
index 1002ae1..04e3fd9 100644 (file)
@@ -41,7 +41,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.analyzeAjax();
+      this.analyzeAjax();
 
       // Select / deselect all checkboxes
       currentModal.on('click', '.t3js-databaseAnalyzer-suggestion-block-checkbox', function(e) {
@@ -65,9 +65,9 @@ define([
 
     analyzeAjax: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
-      modalContent.find(self.selectorOutputContainer).append(message);
+      modalContent.find(this.selectorOutputContainer).append(message);
       $(this.selectorExecuteTrigger).prop('disabled', true);
       $(this.selectorAnalyzeTrigger).prop('disabled', true);
 
@@ -125,16 +125,17 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     execute: function() {
       var self = this;
-      var executeToken = self.currentModal.find(self.selectorModuleContent).data('database-analyzer-execute-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('database-analyzer-execute-token');
       var selectedHashes = [];
-      self.currentModal.find('.t3js-databaseAnalyzer-output .t3js-databaseAnalyzer-suggestion-line input:checked').each(function() {
+      this.currentModal.find('.t3js-databaseAnalyzer-output .t3js-databaseAnalyzer-suggestion-line input:checked').each(function() {
         selectedHashes.push($(this).data('hash'));
       });
       $(this.selectorExecuteTrigger).prop('disabled', true);
@@ -161,7 +162,7 @@ define([
           self.analyzeAjax();
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index e7efb8c..57f9873 100644 (file)
@@ -48,7 +48,9 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          // In case the dump action fails (typically 500 from server), do not kill the entire
+          // install tool, instead show a notification that something went wrong.
+          Notification.error('Dumping autoload files went wrong on the server side. Check the system for broken extensions and try again')
         },
         complete: function() {
           $trigger.removeClass('disabled');
index 3498afb..07ee7d9 100644 (file)
@@ -38,7 +38,7 @@ define([
       this.currentModal = currentModal;
 
       // Get status on initialize to have the badge and content ready
-      self.runTests();
+      this.runTests();
 
       currentModal.on('click', this.selectorExecuteTrigger, function(e) {
         e.preventDefault();
@@ -48,11 +48,11 @@ define([
 
     runTests: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $errorBadge = $(this.selectorGridderBadge);
       $errorBadge.text('').hide();
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
-      modalContent.find(self.selectorOutputContainer).empty().append(message);
+      modalContent.find(this.selectorOutputContainer).empty().append(message);
       $.ajax({
         url: Router.getUrl('environmentCheckGetStatus'),
         cache: false,
@@ -85,7 +85,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index f79cb7a..b3b4487 100644 (file)
@@ -36,7 +36,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getLoadedExtensionList();
+      this.getLoadedExtensionList();
 
       currentModal.on('click', this.selectorCheckTrigger, function(e) {
         currentModal.find(self.selectorUninstallTrigger).hide();
@@ -53,8 +53,8 @@ define([
       this.currentModal.find(this.selectorCheckTrigger).prop('disabled', true);
 
       this.currentModal.find('.modal-loading').hide();
-      const modalContent = this.currentModal.find(self.selectorModalBody);
-      const $outputContainer = this.currentModal.find(self.selectorOutputContainer);
+      const modalContent = this.currentModal.find(this.selectorModalBody);
+      const $outputContainer = this.currentModal.find(this.selectorOutputContainer);
       const message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.append(message);
 
@@ -104,14 +104,13 @@ define([
           }
         },
         error: function (xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     loadExtLocalconf: function(extension) {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-load-ext_localconf-token');
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-load-ext_localconf-token');
       var $ajax = $.ajax({
         url: Router.getUrl(),
         method: 'POST',
@@ -134,8 +133,7 @@ define([
     },
 
     loadExtTables: function(extension) {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-load-ext_tables-token');
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-load-ext_tables-token');
       var $ajax = $.ajax({
         url: Router.getUrl(),
         method: 'POST',
@@ -164,8 +162,8 @@ define([
      */
     uninstallExtension: function(extension) {
       var self = this;
-      var executeToken = self.currentModal.find(self.selectorModuleContent).data('extension-compat-tester-uninstall-extension-token');
-      var modalContent = self.currentModal.find(self.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-compat-tester-uninstall-extension-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $outputContainer = $(this.selectorOutputContainer);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.append(message);
@@ -196,7 +194,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index 5795d4c..37f5f93 100644 (file)
@@ -36,7 +36,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getContent();
+      this.getContent();
 
       // Focus search field on certain user interactions
       currentModal.on('keydown', function(e) {
@@ -83,7 +83,7 @@ define([
 
     getContent: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('extensionConfigurationGetContent'),
         cache: false,
@@ -99,7 +99,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
@@ -110,8 +110,8 @@ define([
      * @param {jQuery} $form The form of the current extension
      */
     write: function($form) {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('extension-configuration-write-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-configuration-write-token');
       var extensionConfiguration = {};
       $.each($form.serializeArray(), function() {
         extensionConfiguration[this.name] = this.value;
@@ -138,7 +138,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       }).always(function() {
 
index f060cbc..88480db 100644 (file)
@@ -31,7 +31,7 @@ define(['jquery',
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getData();
+      this.getData();
 
       currentModal.on('show.bs.collapse', self.selectorExtensionContainer, function(e) {
         // Scan a single extension by opening the panel
@@ -56,8 +56,7 @@ define(['jquery',
     },
 
     getData: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('extensionScannerGetData'),
         cache: false,
@@ -69,7 +68,7 @@ define(['jquery',
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
@@ -87,14 +86,14 @@ define(['jquery',
      */
     scanAll: function($extensions) {
       var self = this;
-      self.currentModal.find(this.selectorExtensionContainer)
+      this.currentModal.find(this.selectorExtensionContainer)
         .removeClass('panel-danger panel-warning panel-success')
         .find('.panel-progress-bar')
         .css('width', 0)
         .attr('aria-valuenow', 0)
         .find('span')
         .text('0%');
-      self.setProgressForAll();
+      this.setProgressForAll();
       $extensions.each(function() {
         var $me = $(this);
         var extension = $me.data('extension');
@@ -135,13 +134,14 @@ define(['jquery',
     setProgressForAll: function() {
       var self = this;
       // var numberOfExtensions = $(this.selectorExtensionContainer).length;
-      var numberOfExtensions = self.currentModal.find(this.selectorExtensionContainer).length;
-      var numberOfSuccess = self.currentModal.find(this.selectorExtensionContainer + '.t3js-extensionscan-finished.panel-success').length;
-      var numberOfWarning = self.currentModal.find(this.selectorExtensionContainer + '.t3js-extensionscan-finished.panel-warning').length;
-      var numberOfError = self.currentModal.find(this.selectorExtensionContainer + '.t3js-extensionscan-finished.panel-danger').length;
+      var numberOfExtensions = this.currentModal.find(this.selectorExtensionContainer).length;
+      var numberOfSuccess = this.currentModal.find(this.selectorExtensionContainer + '.t3js-extensionscan-finished.panel-success').length;
+      var numberOfWarning = this.currentModal.find(this.selectorExtensionContainer + '.t3js-extensionscan-finished.panel-warning').length;
+      var numberOfError = this.currentModal.find(this.selectorExtensionContainer + '.t3js-extensionscan-finished.panel-danger').length;
       var numberOfScannedExtensions = numberOfSuccess + numberOfWarning + numberOfError;
       var percent = (numberOfScannedExtensions / numberOfExtensions) * 100;
-      self.currentModal.find('.t3js-extensionScanner-progress-all-extension .progress-bar')
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      this.currentModal.find('.t3js-extensionScanner-progress-all-extension .progress-bar')
         .css('width', percent + '%')
         .attr('aria-valuenow', percent)
         .find('span')
@@ -166,7 +166,7 @@ define(['jquery',
             }
           },
           error: function(xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, modalContent);
           }
         });
       }
@@ -191,8 +191,8 @@ define(['jquery',
      */
     scanSingleExtension: function(extension) {
       var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('extension-scanner-files-token');
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('extension-scanner-files-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $extensionContainer = this.currentModal.find(this.getExtensionSelector(extension));
       var hitTemplate = '#t3js-extensionScanner-file-hit-template';
       var restTemplate = '#t3js-extensionScanner-file-hit-rest-template';
@@ -327,7 +327,7 @@ define(['jquery',
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index 400e96c..15b9b8b 100644 (file)
@@ -30,7 +30,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getContent();
+      this.getContent();
 
       currentModal.on('click', this.selectorSaveTrigger, function(e) {
         e.preventDefault();
@@ -39,8 +39,7 @@ define([
     },
 
     getContent: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('featuresGetContent'),
         cache: false,
@@ -52,16 +51,16 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     save: function() {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('features-save-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('features-save-token');
       var postData = {};
-      $(self.currentModal.find(this.selectorModuleContent + ' form').serializeArray()).each(function() {
+      $(this.currentModal.find(this.selectorModuleContent + ' form').serializeArray()).each(function() {
         postData[this.name] = this.value;
       });
       postData['install[action]'] = 'featuresSave';
@@ -81,7 +80,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index bfd01a5..c0f4c49 100644 (file)
@@ -43,7 +43,7 @@ define(['jquery',
       this.currentModal = currentModal;
 
       // Get status on initialize to have the badge and content ready
-      self.getStatus();
+      this.getStatus();
 
       currentModal.on('click', this.selectorErrorFixTrigger, function(e) {
         e.preventDefault();
@@ -53,7 +53,7 @@ define(['jquery',
 
     getStatus: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $errorBadge = $(this.selectorGridderBadge);
       $errorBadge.text('').hide();
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
@@ -98,13 +98,14 @@ define(['jquery',
           modalContent.find(self.selectorPermissionContainer).append(message);
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     fix: function() {
       var self = this;
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $outputContainer = this.currentModal.find(this.selectorOutputContainer);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.empty().html(message);
@@ -129,7 +130,7 @@ define(['jquery',
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
index 98e6f08..b2b084b 100644 (file)
@@ -48,7 +48,7 @@ define(['jquery',
 
     getData: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('imageProcessingGetData'),
         cache: false,
@@ -61,14 +61,14 @@ define(['jquery',
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     runTests: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $twinImageTemplate = this.currentModal.find(this.selectorTwinImageTemplate);
       modalContent.find(this.selectorTestContainer).each(function() {
         var $container = $(this);
@@ -109,7 +109,7 @@ define(['jquery',
             }
           },
           error: function(xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, modalContent);
           }
         });
       });
index 8fcf78e..dedc5ab 100644 (file)
@@ -61,7 +61,7 @@ define([
       this.currentModal = currentModal;
 
       // Get configuration list on modal open
-      self.getData();
+      this.getData();
 
       currentModal.on('click', this.selectorAddLanguageToggle, function(e) {
         currentModal.find(self.selectorContentContainer + ' ' + self.selectorLanguageInactive).toggle();
@@ -89,7 +89,7 @@ define([
 
     getData: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('languagePacksGetData'),
         cache: false,
@@ -111,13 +111,14 @@ define([
           self.renderNotifications();
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     activateLanguage: function(iso) {
       var self = this;
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $outputContainer = this.currentModal.find(this.selectorOutputContainer);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.empty().append(message);
@@ -129,7 +130,7 @@ define([
         data: {
           'install': {
             'action': 'languagePacksActivateLanguage',
-            'token': self.currentModal.find(self.selectorModuleContent).data('language-packs-activate-language-token'),
+            'token': this.currentModal.find(this.selectorModuleContent).data('language-packs-activate-language-token'),
             'iso': iso
           }
         },
@@ -151,13 +152,14 @@ define([
           this.getData();
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     deactivateLanguage: function(iso) {
       var self = this;
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $outputContainer = this.currentModal.find(this.selectorOutputContainer);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.empty().append(message);
@@ -190,7 +192,7 @@ define([
           this.getData();
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
@@ -271,6 +273,7 @@ define([
 
     packUpdateDone: function(updateIsoTimes, isos) {
       var self = this;
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $outputContainer = this.currentModal.find(this.selectorOutputContainer);
       if (this.packsUpdateDetails.handled === this.packsUpdateDetails.toHandle) {
         // All done - create summary, update 'last update' of iso list, render main view
@@ -290,7 +293,7 @@ define([
             data: {
               'install': {
                 'action': 'languagePacksUpdateIsoTimes',
-                'token': self.currentModal.find(self.selectorModuleContent).data('language-packs-update-iso-times-token'),
+                'token': this.currentModal.find(this.selectorModuleContent).data('language-packs-update-iso-times-token'),
                 'isos': isos
               }
             },
@@ -304,7 +307,7 @@ define([
               }
             },
             error: function(xhr) {
-              Router.handleAjaxError(xhr);
+              Router.handleAjaxError(xhr, modalContent);
             }
           });
         } else {
index 177e5b5..7976eb9 100644 (file)
@@ -37,7 +37,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getContent();
+      this.getContent();
 
       // Write out new settings
       currentModal.on('click', this.selectorWriteTrigger, function() {
@@ -99,8 +99,7 @@ define([
     },
 
     getContent: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('localConfigurationGetContent'),
         cache: false,
@@ -115,16 +114,16 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     write: function() {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('local-configuration-write-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('local-configuration-write-token');
       var configurationValues = {};
-      self.currentModal.find('.t3js-localConfiguration-pathValue').each(function(i, element) {
+      this.currentModal.find('.t3js-localConfiguration-pathValue').each(function(i, element) {
         var $element = $(element);
         if ($element.attr('type') === 'checkbox') {
           if (element.checked) {
@@ -157,7 +156,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index dbea150..41f3fb1 100644 (file)
@@ -45,8 +45,7 @@ define([
     },
 
     getData: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('mailTestGetData'),
         cache: false,
@@ -58,14 +57,13 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     send: function() {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('mail-test-token');
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('mail-test-token');
       var $outputContainer = this.currentModal.find(this.selectorOutputContainer);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.empty().html(message);
@@ -76,7 +74,7 @@ define([
           'install': {
             'action': 'mailTest',
             'token': executeToken,
-            'email': self.currentModal.find('.t3js-mailTest-email').val()
+            'email': this.currentModal.find('.t3js-mailTest-email').val()
           }
         },
         cache: false,
index 8f96971..ff27ca6 100644 (file)
@@ -32,14 +32,12 @@ define([
 
 
     initialize: function(currentModal) {
-      var self = this;
       this.currentModal = currentModal;
-      self.getData();
+      this.getData();
     },
 
     getData: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('phpInfoGetData'),
         cache: false,
@@ -51,7 +49,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index a27e8b0..24e39d3 100644 (file)
@@ -36,7 +36,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.getContent();
+      this.getContent();
 
       // Load content with post data on click 'custom image executable path'
       currentModal.on('click', this.selectorImageExecutableTrigger, function(e) {
@@ -57,8 +57,7 @@ define([
     },
 
     getContent: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('presetsGetContent'),
         cache: false,
@@ -70,15 +69,14 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     getCustomImagePathContent: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
-      var presetsContentToken = self.currentModal.find(this.selectorModuleContent).data('presets-content-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var presetsContentToken = this.currentModal.find(this.selectorModuleContent).data('presets-content-token');
       $.ajax({
         url: Router.getUrl(),
         method: 'POST',
@@ -88,7 +86,7 @@ define([
             'action': 'presetsGetContent',
             'values': {
               'Image': {
-                'additionalSearchPath': self.currentModal.find(this.selectorImageExecutable).val()
+                'additionalSearchPath': this.currentModal.find(this.selectorImageExecutable).val()
               }
             }
           }
@@ -102,16 +100,16 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     activate: function() {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('presets-activate-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('presets-activate-token');
       var postData = {};
-      $(self.currentModal.find(this.selectorModuleContent + ' form').serializeArray()).each(function() {
+      $(this.currentModal.find(this.selectorModuleContent + ' form').serializeArray()).each(function() {
         postData[this.name] = this.value;
       });
       postData['install[action]'] = 'presetsActivate';
@@ -131,7 +129,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index 59cadbe..475d2b6 100644 (file)
@@ -47,7 +47,9 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          // If reset fails on server side (typically a 500), do not crash entire install tool
+          // but render an error notification instead.
+          Notification.error('Resetting backend user uc failed. Please check the system for missing database fields and try again.');
         },
         complete: function() {
           $trigger.removeClass('disabled');
index 2dd58a6..257671a 100644 (file)
@@ -118,7 +118,7 @@ define([
 
     executeSilentConfigurationUpdate: function() {
       var self = this;
-      self.updateLoadingInfo('Executing silent configuration update');
+      this.updateLoadingInfo('Executing silent configuration update');
       $.ajax({
         url: this.getUrl('executeSilentConfigurationUpdate', 'layout'),
         cache: false,
@@ -144,7 +144,7 @@ define([
      */
     executeSilentLegacyExtConfExtensionConfigurationUpdate: function() {
       var self = this;
-      self.updateLoadingInfo('Executing silent extension configuration update');
+      this.updateLoadingInfo('Executing silent extension configuration update');
       $.ajax({
         url: this.getUrl('executeSilentLegacyExtConfExtensionConfigurationUpdate', 'layout'),
         cache: false,
@@ -168,7 +168,7 @@ define([
      */
     executeSilentExtensionConfigurationSynchronization: function() {
       var self = this;
-      self.updateLoadingInfo('Executing silent extension configuration synchronization');
+      this.updateLoadingInfo('Executing silent extension configuration synchronization');
       $.ajax({
         url: this.getUrl('executeSilentExtensionConfigurationSynchronization', 'layout'),
         cache: false,
@@ -189,7 +189,7 @@ define([
     loadMainLayout: function() {
       var self = this;
       var $outputContainer = $(this.selectorBody);
-      self.updateLoadingInfo('Loading main layout');
+      this.updateLoadingInfo('Loading main layout');
       $.ajax({
         url: this.getUrl('mainLayout', 'layout'),
         cache: false,
@@ -213,7 +213,7 @@ define([
       });
     },
 
-    handleAjaxError: function(xhr) {
+    handleAjaxError: function(xhr, $outputContainer) {
       var message = '';
       if (xhr.status === 403) {
         // Install tool session expired - depending on context render error message or login
@@ -230,11 +230,44 @@ define([
       } else {
         // @todo Recovery tests should be started here
         var url = this.getUrl(undefined, 'upgrade');
-        message = '<div class="t3js-infobox callout callout-sm callout-danger"><div class="callout-body">'
-          + 'Something went wrong. Please use <b><a href="' + url + '">Check for broken'
-          + ' extensions</a></b> to see if a loaded extension breaks this part of the install tool'
-          + ' and unload it.</div></div>';
-        $(this.selectorBody).empty().html(message);
+        message =
+          '<div class="t3js-infobox callout callout-sm callout-danger">'
+            + '<div class="callout-body">'
+              + '<p>Something went wrong. Please use <b><a href="' + url + '">Check for broken'
+              + ' extensions</a></b> to see if a loaded extension breaks this part of the install tool'
+              + ' and unload it.</p>'
+              + '<p>The box below may additionally reveal further details on what went wrong depending on your debug settings.'
+              + ' It may help to temporarily switch to debug mode using <b>Settings > Configuration Presets > Debug settings.</b></p>'
+              + '<p>If this error happens at an early state and no full exception back trace is shown, it may also help'
+              + ' to manually increase debugging output in <code>typo3conf/LocalConfiguration.php</code>:'
+              + '<code>[\'BE\'][\'debug\'] => true</code>, <code>[\'SYS\'][\'devIPmask\'] => \'*\'</code>, <code>[\'SYS\'][\'displayErrors\'] => 1</code>,'
+              + '<code>[\'SYS\][\'systemLogLevel\'] => 0</code>, <code>[\'SYS\'][\'exceptionalErrors\'] => 12290</code></p>'
+            + '</div>'
+          + '</div>'
+          + '<div class="panel-group" role="tablist" aria-multiselectable="true">'
+            + '<div class="panel panel-default panel-flat searchhit">'
+              + '<div class="panel-heading" role="tab" id="heading-error">'
+                + '<h3 class="panel-title">'
+                  + '<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse-error" aria-expanded="true" aria-controls="collapse-error" class="collapsed">'
+                    + '<span class="caret"></span>'
+                    + '<strong>Ajax error</strong>'
+                  + '</a>'
+                +'</h3>'
+              + '</div>'
+              + '<div id="collapse-error" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-error">'
+              + '<div class="panel-body">'
+                + xhr.responseText
+              + '</div>'
+            + '</div>'
+          + '</div>';
+
+        if (typeof $outputContainer !== 'undefined') {
+          // Write to given output container. This is typically a modal if given
+          $outputContainer.empty().html(message);
+        } else {
+          // Else write to main frame
+          $(this.selectorBody).empty().html(message);
+        }
       }
     },
 
@@ -249,6 +282,9 @@ define([
           } else {
             self.showEnableInstallTool();
           }
+        },
+        error: function(xhr) {
+          self.handleAjaxError(xhr);
         }
       });
     },
@@ -262,6 +298,9 @@ define([
           if (data.success === true) {
             $(self.selectorBody).empty().append(data.html);
           }
+        },
+        error: function(xhr) {
+          self.handleAjaxError(xhr);
         }
       });
     },
@@ -277,6 +316,9 @@ define([
           } else {
             self.showLogin();
           }
+        },
+        error: function(xhr) {
+          self.handleAjaxError(xhr);
         }
       });
     },
@@ -290,6 +332,9 @@ define([
           if (data.success === true) {
             $(self.selectorBody).empty().append(data.html);
           }
+        },
+        error: function(xhr) {
+          self.handleAjaxError(xhr);
         }
       });
     },
@@ -300,7 +345,7 @@ define([
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.empty().html(message);
       $.ajax({
-        url: self.getUrl(),
+        url: this.getUrl(),
         cache: false,
         method: 'POST',
         data: {
@@ -319,6 +364,9 @@ define([
               $outputContainer.empty().html(message);
             });
           }
+        },
+        error: function(xhr) {
+          self.handleAjaxError(xhr);
         }
       });
     },
@@ -332,6 +380,9 @@ define([
           if (data.success === true) {
             self.showEnableInstallTool();
           }
+        },
+        error: function(xhr) {
+          self.handleAjaxError(xhr);
         }
       });
     },
index 8e89725..ee9f88e 100644 (file)
@@ -32,14 +32,12 @@ define([
 
 
     initialize: function(currentModal) {
-      var self = this;
       this.currentModal = currentModal;
-      self.getData();
+      this.getData();
     },
 
     getData: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('systemInformationGetData'),
         cache: false,
@@ -51,7 +49,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index afb2e21..3ec5c88 100644 (file)
@@ -46,7 +46,7 @@ define([
         });
       }
       else {
-        self.getList();
+        this.getList();
       }
 
       currentModal.on('click', this.selectorWriteTrigger, function(e) {
@@ -58,7 +58,7 @@ define([
 
     getList: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('systemMaintainerGetList'),
         cache: false,
@@ -97,7 +97,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
 
@@ -105,9 +105,9 @@ define([
     },
 
     write: function() {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('system-maintainer-write-token');
-      var selectedUsers = self.currentModal.find(this.selectorChosenField).val();
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('system-maintainer-write-token');
+      var selectedUsers = this.currentModal.find(this.selectorChosenField).val();
       $.ajax({
         method: 'POST',
         url: Router.getUrl(),
@@ -130,7 +130,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index 4bc712e..b5a0e47 100644 (file)
@@ -31,9 +31,8 @@ define([
     selectorOutputContainer: '.t3js-tcaExtTablesCheck-output',
 
     initialize: function(currentModal) {
-      var self = this;
       this.currentModal = currentModal;
-      self.check();
+      this.check();
       currentModal.on('click',  this.selectorCheckTrigger, function(e) {
         e.preventDefault();
         self.check();
@@ -42,7 +41,7 @@ define([
 
     check: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $outputContainer = $(this.selectorOutputContainer);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.empty().html(message);
@@ -73,7 +72,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index 07ed456..e9a5e51 100644 (file)
@@ -33,7 +33,7 @@ define([
     initialize: function(currentModal) {
       var self = this;
       this.currentModal = currentModal;
-      self.check();
+      this.check();
       currentModal.on('click',  this.selectorCheckTrigger, function(e) {
         e.preventDefault();
         self.check();
@@ -43,7 +43,7 @@ define([
     check: function() {
       var self = this;
       var $outputContainer = $(this.selectorOutputContainer);
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var message = ProgressBar.render(Severity.loading, 'Loading...', '');
       $outputContainer.empty().html(message);
       $.ajax({
@@ -74,7 +74,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     }
index a93a5f0..ceddf54 100644 (file)
@@ -49,7 +49,7 @@ define([
         });
       }
       else {
-        self.getContent();
+        this.getContent();
       }
 
       // Mark a file as read
@@ -70,7 +70,7 @@ define([
 
     getContent: function() {
       var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       $.ajax({
         url: Router.getUrl('upgradeDocsGetContent'),
         cache: false,
@@ -82,6 +82,9 @@ define([
             self.initializeChosenSelector();
             self.loadChangelogs();
           }
+        },
+        error: function(xhr) {
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
@@ -89,6 +92,7 @@ define([
     loadChangelogs: function() {
       var self = this;
       var promises = [];
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       this.currentModal.find(this.selectorChangeLogsForVersionContainer).each(function(index, el) {
         var $request = $.ajax({
           url: Router.getUrl('upgradeDocsGetChangelogForVersion'),
@@ -113,7 +117,7 @@ define([
             }
           },
           error: function(xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, modalContent);
           }
         });
 
@@ -176,8 +180,7 @@ define([
     },
 
     combinedFilterSearch: function() {
-      var self = this;
-      var modalContent = this.currentModal.find(self.selectorModalBody);
+      var modalContent = this.currentModal.find(this.selectorModalBody);
       var $items = modalContent.find('div.item');
       if (this.chosenField.val().length < 1 && this.fulltextSearchField.val().length < 1) {
         $('.panel-version:not(:first) > .panel-collapse').collapse('hide');
@@ -187,13 +190,13 @@ define([
       $items.addClass('hidden').removeClass('searchhit filterhit');
 
       // apply tags
-      if (self.chosenField.val().length > 0) {
+      if (this.chosenField.val().length > 0) {
         $items
           .addClass('hidden')
           .removeClass('filterhit');
         var orTags = [];
         var andTags = [];
-        $.each(self.chosenField.val(), function(index, item) {
+        $.each(this.chosenField.val(), function(index, item) {
           var tagFilter = '[data-item-tags*="' + item + '"]';
           if (item.indexOf(':') > 0) {
             orTags.push(tagFilter);
@@ -220,7 +223,7 @@ define([
           .removeClass('hidden');
       }
       // apply fulltext search
-      var typedQuery = self.fulltextSearchField.val();
+      var typedQuery = this.fulltextSearchField.val();
       modalContent.find('div.item.filterhit').each(function() {
         var $item = $(this);
         if ($(':contains(' + typedQuery + ')', $item).length > 0 || $('input[value*="' + typedQuery + '"]', $item).length > 0) {
@@ -262,12 +265,12 @@ define([
     },
 
     markRead: function(element) {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('upgrade-docs-mark-read-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('upgrade-docs-mark-read-token');
       var $button = $(element).closest('a');
       $button.toggleClass('t3js-upgradeDocs-unmarkRead t3js-upgradeDocs-markRead');
       $button.find('i').toggleClass('fa-check fa-ban');
-      $button.closest('.panel').appendTo(self.currentModal.find('.panel-body-read'));
+      $button.closest('.panel').appendTo(this.currentModal.find('.panel-body-read'));
       $.ajax({
         method: 'POST',
         url: Router.getUrl(),
@@ -279,19 +282,19 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
 
     unmarkRead: function(element) {
-      var self = this;
-      var executeToken = self.currentModal.find(this.selectorModuleContent).data('upgrade-docs-unmark-read-token');
+      var modalContent = this.currentModal.find(this.selectorModalBody);
+      var executeToken = this.currentModal.find(this.selectorModuleContent).data('upgrade-docs-unmark-read-token');
       var $button = $(element).closest('a');
       var version = $button.closest('.panel').data('item-version');
       $button.toggleClass('t3js-upgradeDocs-markRead t3js-upgradeDocs-unmarkRead');
       $button.find('i').toggleClass('fa-check fa-ban');
-      $button.closest('.panel').appendTo(self.currentModal.find('*[data-group-version="' + version + '"] .panel-body'));
+      $button.closest('.panel').appendTo(this.currentModal.find('*[data-group-version="' + version + '"] .panel-body'));
       $.ajax({
         method: 'POST',
         url: Router.getUrl(),
@@ -303,7 +306,7 @@ define([
           }
         },
         error: function(xhr) {
-          Router.handleAjaxError(xhr);
+          Router.handleAjaxError(xhr, modalContent);
         }
       });
     },
index fd0b0a4..100c930 100644 (file)
@@ -105,7 +105,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -129,7 +129,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -157,7 +157,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -199,7 +199,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -228,7 +228,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -286,7 +286,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -333,7 +333,7 @@ define([
             modalContent.find(self.selectorOutputWizardsContainer).append(input);
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -353,7 +353,7 @@ define([
         var $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
         // modalContent.find(self.selectorOutputWizardsContainer).empty();
         $outputContainer.empty().html(this.renderProgressBar('Executing "' + title + '"...'));
-        this.currentModal.find(self.selectorWizardsDoneRowMarkUndone).prop("disabled", true);
+        this.currentModal.find(this.selectorWizardsDoneRowMarkUndone).prop("disabled", true);
         $.ajax({
           method: 'POST',
           data: postData,
@@ -376,7 +376,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -429,7 +429,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },
@@ -465,7 +465,7 @@ define([
             }
           },
           error: function (xhr) {
-            Router.handleAjaxError(xhr);
+            Router.handleAjaxError(xhr, $outputContainer);
           }
         });
       },