[BUGFIX] Extension Manager Cleanup
authorSteffen Kamper <info@sk-typo3.de>
Tue, 2 Aug 2011 09:02:21 +0000 (11:02 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 Aug 2011 20:14:34 +0000 (22:14 +0200)
Beside some type hintings and indent correction there is now a check
in response for timeout with fetching translation, so the UI is not
blocked anymore if a timeout occurs.

Change-Id: I670a2df4fddab0be6b0cb05e69e009c08db5e1fa
Resolves: #28667
Reviewed-on: http://review.typo3.org/4012
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php
typo3/sysext/em/classes/settings/class.tx_em_settings.php
typo3/sysext/em/res/js/em_languages.js

index f406380..14bb46c 100644 (file)
@@ -1230,7 +1230,9 @@ class tx_em_Connection_ExtDirectServer {
        public function fetchTranslations($extkey, $type, $selection) {
                $result = array();
                if (is_array($selection) && count($selection)) {
+                       /** @var $terConnection tx_em_Connection_Ter */
                        $terConnection = t3lib_div::makeInstance('tx_em_Connection_Ter', $this);
+                       /** @var $xmlHandler tx_em_Tools_XmlHandler */
                        $this->xmlHandler = t3lib_div::makeInstance('tx_em_Tools_XmlHandler');
                        $this->xmlHandler->emObj = $this;
                        $mirrorURL = $this->getSettingsObject()->getMirrorURL();
index efb0fdb..34ccf86 100644 (file)
@@ -183,9 +183,10 @@ class tx_em_Settings implements t3lib_Singleton {
                                $this->settings['selectedRepository'] = 1;
                        }
                }
-                       /** @var $repository tx_em_Repository */
-                       $repository = t3lib_div::makeInstance('tx_em_Repository', $this->settings['selectedRepository']);
-                       if ($repository->getMirrorListUrl()) {
+               /** @var $repository tx_em_Repository */
+               $repository = t3lib_div::makeInstance('tx_em_Repository', $this->settings['selectedRepository']);
+               if ($repository->getMirrorListUrl()) {
+                       /** @var $objRepositoryUtility tx_em_Repository_Utility */
                        $objRepositoryUtility = t3lib_div::makeInstance('tx_em_Repository_Utility', $repository);
                        $mirrors = $objRepositoryUtility->getMirrors(TRUE)->getMirrors();
                        if(!is_array($mirrors)) {
index adce6f9..b6e5c75 100644 (file)
@@ -285,8 +285,12 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                                                TYPO3.l10n.localize('translation_checking')
                                                        );
                                                        TYPO3.EM.ExtDirect.fetchTranslations(record.data.extkey, 1, [lang], function(response) {
-                                                               record.set(lang, response[lang]);
-                                                               record.commit();
+                                                               if (response && Ext.isArray(response)) {
+                                                                       record.set(lang, response[lang]);
+                                                                       record.commit();
+                                                               } else {
+                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('extDirect_timeoutHeader'), TYPO3.l10n.localize('extDirect_timeoutMessage'), 5);
+                                                               }
                                                                this.waitBox.hide()
                                                        }, this);
                                                }
@@ -402,7 +406,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                if (!this.selectedLanguages.length) {
                        this.getSelectedLanguages();
                }
-               // start process
+                       // start process
                this.interruptProcess = false;
                Ext.getCmp('em-extlanguagegrid').fetchingProcess = true;
                this.fetchLanguage();
@@ -416,7 +420,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
 
 
                if (response) {
-                       // update fetched record
+                               // update fetched record
                        var fetchedRecord = grid.store.getAt(row - 1);
                        for (i = 0; i < this.selectedLanguages.length; i++) {
                                fetchedRecord.set(this.selectedLanguages[i], response[this.selectedLanguages[i]]);