[BUGFIX] Incompatible declaration of PreviewController::initializeView 86/47086/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 2 Mar 2016 09:37:12 +0000 (10:37 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 4 Mar 2016 20:50:27 +0000 (21:50 +0100)
The declaration of PreviewController::initializeView is changed to be
functional with PHP 7.

Change-Id: I4b59600aa3d98dec6440551f4228c9aad6fd6714
Resolves: #73866
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47086
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/workspaces/Classes/Controller/PreviewController.php

index 8d00b31..e9a5bc6 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
 
 /**
  * Implements the preview controller of the workspace module.
@@ -37,13 +38,16 @@ class PreviewController extends AbstractController
     /**
      * Set up the doc header properly here
      *
-     * @param BackendTemplateView $view
+     * @param ViewInterface $view
      */
-    protected function initializeView(BackendTemplateView $view)
+    protected function initializeView(ViewInterface $view)
     {
-        parent::initializeView($view);
-        $view->getModuleTemplate()->getDocHeaderComponent()->disable();
-        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
+        if ($view instanceof BackendTemplateView) {
+            /** @var BackendTemplateView $view */
+            parent::initializeView($view);
+            $view->getModuleTemplate()->getDocHeaderComponent()->disable();
+            $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
+        }
     }
 
     /**