[BUGFIX] Check for BackendTemplateView in IndexedSearch 62/44862/2
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Sat, 21 Nov 2015 15:21:10 +0000 (16:21 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 21 Nov 2015 15:23:50 +0000 (16:23 +0100)
We need to check for the correct View Object before
working with ModuleTemplate because Extbase initializes a
view even if there is none.

Resolves: #71754
Releases: master
Change-Id: I4e66b7d087af310d0f3dc096b2fc893c8016b92e
Reviewed-on: https://review.typo3.org/44862
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php

index dc931c2..b132d7a 100644 (file)
@@ -85,13 +85,15 @@ class AdministrationController extends ActionController
      */
     protected function initializeView(ViewInterface $view)
     {
-        /** @var BackendTemplateView $view */
-        parent::initializeView($view);
-        $permissionClause = $this->getBackendUserAuthentication()->getPagePermsClause(1);
-        $pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause);
-        $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
-        $this->generateMenu();
-        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
+        if ($view instanceof BackendTemplateView) {
+            /** @var BackendTemplateView $view */
+            parent::initializeView($view);
+            $permissionClause = $this->getBackendUserAuthentication()->getPagePermsClause(1);
+            $pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause);
+            $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
+            $this->generateMenu();
+            $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
+        }
     }
 
     /**