[BUGFIX] Throw Exception if typo3 extension repository is not defined 29/19629/2
authorSascha Egerer <sascha.egerer@dkd.de>
Fri, 5 Apr 2013 20:20:17 +0000 (22:20 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 5 Apr 2013 20:52:59 +0000 (22:52 +0200)
When there is no repository with id 1 is defined
in tx_extensionmanager_domain_model_extension you get an exception if
you try to update the extension list

Resolves: #42849
Releases: 6.1, 6.0
Change-Id: Ia60aa2227ab3a801c9002d821295c6eb01043e3f
Reviewed-on: https://review.typo3.org/19629
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/Utility/Repository/Helper.php
typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf

index 31da986..5122043 100644 (file)
@@ -83,9 +83,12 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface {
                $repositoryRepository = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository');
                $this->extensionRepository = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
                $repository = $repositoryRepository->findByUid(1);
-               if (is_object($repository)) {
-                       $this->setRepository($repository);
+
+               if(!is_object($repository)) {
+                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('The typo3.org extension repository was not found. Please go to the "Update Wizard" in the install tool and run the task "Add the default Extension Manager database tables".', 1365192900);
                }
+
+               $this->setRepository($repository);
        }
 
        /**
index 3afaf05..9ccc3ea 100644 (file)
                                <source>Error</source>
                        </trans-unit>
                        <trans-unit id="report.status.mainRepository.notFound.message" xml:space="preserve">
-                               <source>The typo3.org extension repository was not found. Please import the main typo3.org extension repository in the install tool wizard.</source>
+                               <source>The typo3.org extension repository was not found. Please go to the "Update Wizard" in the install tool and run the task "Add the default Extension Manager database tables".</source>
                        </trans-unit>
                        <trans-unit id="report.status.mainRepository.notUpToDate.value" xml:space="preserve">
                                <source>Extension list is not up to date!</source>