[BUGFIX] Form wizard: Removed call to deprecated method render() 85/46785/2
authorMichael Oehlhof <typo3@oehlhof.de>
Thu, 18 Feb 2016 22:59:25 +0000 (23:59 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 19 Feb 2016 19:32:48 +0000 (20:32 +0100)
Call of FlashMessage->render() if no reference to record
was replaced with appropriate code.

Resolves: #73546
Releases: master, 7.6
Change-Id: I3fa0285ccd68d7a62d63df60b488bb1fb561a243
Reviewed-on: https://review.typo3.org/46785
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Classes/View/Wizard/WizardView.php

index 2a56f42..9e36502 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -374,17 +375,19 @@ class WizardView
      */
     protected function getBodyContent()
     {
-        if ($this->recordIsAvailable) {
-            $bodyContent = '';
-        } else {
+        if (!$this->recordIsAvailable) {
             /** @var $flashMessage FlashMessage */
             $flashMessage = GeneralUtility::makeInstance(FlashMessage::class,
                 $this->getLanguageService()->getLL('errorMessage', true),
                 $this->getLanguageService()->getLL('errorTitle', true),
                 FlashMessage::ERROR);
-            $bodyContent = $flashMessage->render();
+            /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+            $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
+            /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+            $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+            $defaultFlashMessageQueue->enqueue($flashMessage);
         }
-        return $bodyContent;
+        return '';
     }
 
     /**