[BUGFIX] Reports module tries to load not-installed extension 26/22726/4
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 30 Jul 2013 22:28:37 +0000 (00:28 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 8 Aug 2013 21:03:01 +0000 (23:03 +0200)
When you select a report from an extension, the reports module
will remember this when you re-open it. But if you have
uninstalled the extension in the meantime, the reports module
will throw an exception. This is fixed by checking the
$reportClass. If this is NULL then redirect to indexAction.

Change-Id: Ifad4e6ee8dc651a3d6b1360486fd5a7cb2abf111
Resolves: #48523
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22726
Reviewed-by: Stefan Neufeind
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/reports/Classes/Controller/ReportController.php

index 2080d05..bb15855 100644 (file)
@@ -68,7 +68,22 @@ class ReportController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
         */
        public function detailAction($extension, $report) {
                $content = ($error = '');
-               $reportClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'];
+               $reportClass = NULL;
+               if (
+                       isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension])
+                       && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension])
+                       && isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report])
+                       && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report])
+                       && isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'])
+               ) {
+                       $reportClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'];
+               }
+
+               // If extension has been uninstalled/removed redirect to index
+               if ($reportClass === NULL) {
+                       $this->redirect('index');
+               }
+
                $reportInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($reportClass, $this);
                if ($reportInstance instanceof \TYPO3\CMS\Reports\ReportInterface) {
                        $content = $reportInstance->getReport();