[BUGFIX] Show message if no extension repo exists in extensionmanager 82/53482/2
authorMarkus Hoelzle <typo3@markus-hoelzle.de>
Fri, 14 Jul 2017 19:26:24 +0000 (21:26 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 17 Jul 2017 09:32:07 +0000 (11:32 +0200)
Show a useful error message instead an exception in extensionmanager on
update extension list.

Releases: 7.6, 8.7, master
Resolves: #81146
Change-Id: I9989d17890c381a12f17a0806b46ce269ab1ca5d
Reviewed-on: https://review.typo3.org/53482
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Marc von Schalscha <msa@starfinanz.de>
Tested-by: Marc von Schalscha <msa@starfinanz.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php
typo3/sysext/extensionmanager/Classes/Utility/Repository/Helper.php

index 2f41e33..6617634 100644 (file)
@@ -99,7 +99,7 @@ class UpdateFromTerController extends AbstractController
         $repository = $this->repositoryRepository->findByUid((int)$this->settings['repositoryUid']);
 
         $timeFormat = $this->getLanguageService()->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:extensionList.updateFromTer.lastUpdate.fullTimeFormat');
-        $lastUpdateTime = $repository->getLastUpdate();
+        $lastUpdateTime = $repository ? $repository->getLastUpdate() : null;
         if (null === $lastUpdateTime) {
             $lastUpdatedSince = $this->getLanguageService()->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:extensionList.updateFromTer.never');
             $lastUpdateTime = date($timeFormat);
index 9209789..6ef7248 100644 (file)
@@ -259,6 +259,9 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function isExtListUpdateNecessary()
     {
+        if ($this->repository === null) {
+            throw new ExtensionManagerException('No extension repository was found.', 1500060252);
+        }
         $updateNecessity = 0;
         if ($this->extensionRepository->countByRepository($this->repository->getUid()) <= 0) {
             $updateNecessity |= self::PROBLEM_NO_VERSIONS_IN_DATABASE;