[BUGFIX] Configuration controller fatals with local-only extension 38/23738/4
authorSebastian Fischer <typo3@evoweb.de>
Wed, 11 Sep 2013 08:01:14 +0000 (10:01 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 14 Sep 2013 09:39:18 +0000 (11:39 +0200)
If the settings of a local-only extension get saved the configuration
controller fatals. This is because the result of the extension model
repository does not get checked, if it really is a model.

With this fix the instance is first checked and afterwards the category
is read from the model.

Resolves: #51902
Releases: 6.2
Change-Id: I543aa0960f3c2ba1877189b44e47aa7f86c81928
Reviewed-on: https://review.typo3.org/23738
Reviewed-by: Sebastian Michaelsen
Tested-by: Sebastian Michaelsen
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/Controller/ConfigurationController.php

index c516bf2..e83ac1a 100644 (file)
@@ -99,7 +99,9 @@ class ConfigurationController extends \TYPO3\CMS\Extensionmanager\Controller\Abs
                /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension */
                $extension = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extensionKey);
                // Different handling for distribution installation
-               if ($extension->getCategory() === \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::DISTRIBUTION_CATEGORY) {
+               if ($extension instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension &&
+                       $extension->getCategory() === \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::DISTRIBUTION_CATEGORY
+               ) {
                        $this->redirect('welcome', 'Distribution', NULL, array('extension' => $extension->getUid()));
                } else {
                        $this->redirect('showConfigurationForm', NULL, NULL, array('extension' => array('key' => $extensionKey)));