[TASK] Simplify and unify flash message rendering 92/44592/5
authorHelmut Hummel <helmut.hummel@typo3.org>
Sat, 7 Nov 2015 00:19:03 +0000 (01:19 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 8 Nov 2015 10:25:16 +0000 (11:25 +0100)
* Reverts the change that allowed HTML tags by default in flash messages
* Simplifies flash message markup to be bootstrap alert style
* Delegate flash message rendering completely to module template
* Deprecate render method in flash message
* Minor cleanups in flash message view helper and flash message class

Resolves: #71249
Releases: master
Change-Id: Idbb4bc31372fbc435519496168715e0bcc5cebf2
Reviewed-on: https://review.typo3.org/44592
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
34 files changed:
Build/Resources/Public/Less/TYPO3/_module_extensionmanager.less
typo3/sysext/backend/Classes/Template/ModuleTemplate.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Resources/Private/Templates/Module.html
typo3/sysext/beuser/Classes/Controller/BackendUserActionController.php
typo3/sysext/beuser/Classes/Controller/PermissionController.php
typo3/sysext/beuser/Resources/Private/Layouts/Default.html
typo3/sysext/beuser/Resources/Private/Layouts/Permission.html
typo3/sysext/core/Classes/Messaging/FlashMessage.php
typo3/sysext/core/Classes/Messaging/FlashMessageQueue.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-71249-DeprecateRenderMethodOfFlashMessageClass.rst [new file with mode: 0644]
typo3/sysext/documentation/Classes/Controller/DocumentController.php
typo3/sysext/documentation/Resources/Private/Layouts/Default.html
typo3/sysext/extensionmanager/Classes/Controller/AbstractModuleController.php
typo3/sysext/extensionmanager/Resources/Private/Layouts/Main.html
typo3/sysext/extensionmanager/Resources/Private/Templates/Distribution/Show.html
typo3/sysext/extensionmanager/Resources/Private/Templates/List/UnresolvedDependencies.html
typo3/sysext/filelist/Resources/Private/Layouts/Default.html
typo3/sysext/fluid/Classes/ViewHelpers/FlashMessagesViewHelper.php
typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php
typo3/sysext/indexed_search/Resources/Private/Layouts/Administration.html
typo3/sysext/indexed_search/Resources/Private/Templates/Administration/StatisticDetails.html
typo3/sysext/lang/Classes/Controller/LanguageController.php
typo3/sysext/lang/Resources/Private/Templates/Language/ListLanguages.html
typo3/sysext/lang/Resources/Private/Templates/Language/ListTranslations.html
typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php
typo3/sysext/recycler/Resources/Private/Layouts/Default.html
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/t3skin/Resources/Public/Css/backend.css
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Classes/Controller/ReviewController.php
typo3/sysext/workspaces/Resources/Private/Layouts/Module.html
typo3/sysext/workspaces/Resources/Private/Layouts/Nodoc.html

index 4f40939..a7f1a65 100644 (file)
        }
 }
 
-// Distributions detail
-.distribution-detail-flashmessage {
-       margin-bottom: 2.5em;
-       p {
-               padding-bottom: 0;
-       }
-}
 .distribution-detail {
        .clearfix();
        min-width: 750px;
index c50f11c..e124307 100644 (file)
@@ -355,7 +355,7 @@ class ModuleTemplate
         if ($this->moduleName) {
             $this->view->assign('moduleName', $this->moduleName);
         }
-
+        $this->view->assign('flashMessageQueueIdentifier', $this->getFlashMessageQueue()->getIdentifier());
         $renderedPage = $this->pageRenderer->render(PageRenderer::PART_HEADER);
         $renderedPage .= $this->bodyTag;
         $renderedPage .= $this->view->render();
@@ -867,6 +867,14 @@ class ModuleTemplate
     }
 
     /**
+     * @param \TYPO3\CMS\Core\Messaging\FlashMessageQueue $flashMessageQueue
+     */
+    public function setFlashMessageQueue($flashMessageQueue)
+    {
+        $this->flashMessageQueue = $flashMessageQueue;
+    }
+
+    /**
      * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue
      */
     protected function getFlashMessageQueue()
@@ -874,7 +882,7 @@ class ModuleTemplate
         if (!isset($this->flashMessageQueue)) {
             /** @var FlashMessageService $service */
             $service = GeneralUtility::makeInstance(FlashMessageService::class);
-            $this->flashMessageQueue = $service->getMessageQueueByIdentifier('module.template.flashmessages');
+            $this->flashMessageQueue = $service->getMessageQueueByIdentifier();
         }
         return $this->flashMessageQueue;
     }
index de5b1e6..4a5c8f6 100644 (file)
@@ -2168,7 +2168,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     FlashMessage::WARNING
                 );
                 $service = GeneralUtility::makeInstance(FlashMessageService::class);
-                $queue = $service->getMessageQueueByIdentifier('module.template.flashmessages');
+                $queue = $service->getMessageQueueByIdentifier();
                 $queue->addMessage($message);
             }
         }
index e18a281..eaf142e 100644 (file)
@@ -8,9 +8,24 @@
                <f:render partial="DocHeader" arguments="{docHeader:docHeader}" />
        </f:if>
        <div class="module-body t3js-module-body">
-               <f:flashMessages as="flashMessages" queueIdentifier="module.template.flashmessages">
+               <f:flashMessages as="flashMessages" queueIdentifier="{flashMessageQueueIdentifier}">
                        <f:for each="{flashMessages}" as="flashMessage">
-                               {flashMessage}
+                               <div class="alert {flashMessage.class}">
+                                       <div class="media">
+                                               <div class="media-left">
+                                                       <span class="fa-stack fa-lg">
+                                                               <i class="fa fa-circle fa-stack-2x"></i>
+                                                               <i class="fa fa-{flashMessage.iconName} fa-stack-1x"></i>
+                                                       </span>
+                                               </div>
+                                               <div class="media-body">
+                                                       <f:if condition="{flashMessage.title}">
+                                                               <h4 class="alert-title">{flashMessage.title}</h4>
+                                                       </f:if>
+                                                       <div class="alert-message">{flashMessage.message}</div>
+                                               </div>
+                                       </div>
+                               </div>
                        </f:for>
                </f:flashMessages>
                <f:format.raw>{content}</f:format.raw>
index b880186..0aabb6a 100644 (file)
@@ -59,6 +59,7 @@ class BackendUserActionController extends ActionController
             || $this->actionMethodName == 'compareAction') {
             $this->generateMenu();
             $this->registerDocheaderButtons();
+            $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
         }
     }
 
index e01603f..65932d5 100644 (file)
@@ -138,6 +138,7 @@ class PermissionController extends ActionController
                 '
             );
             $this->registerDocHeaderButtons();
+            $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
         }
     }
 
@@ -192,8 +193,8 @@ class PermissionController extends ActionController
         if ($this->getBackendUser()->workspace != 0) {
             // Adding section with the permission setting matrix:
             $this->addFlashMessage(
-                'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText',
-                'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning',
+                LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser'),
+                LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser'),
                 FlashMessage::WARNING
             );
         }
index f9e814a..6072397 100644 (file)
@@ -1,11 +1,2 @@
-<f:be.pageRenderer />
-
 <f:render section="headline" />
-
-<f:flashMessages as="flashMessages">
-       <f:for each="{flashMessages}" as="flashMessage">
-               {flashMessage}
-       </f:for>
-</f:flashMessages>
-
 <f:render section="content" />
index bc8b5eb..6072397 100644 (file)
@@ -1,15 +1,2 @@
-<f:be.pageRenderer />
 <f:render section="headline" />
-
-<f:flashMessages as="flashMessages">
-       <ul class="typo3-flashMessages">
-               <f:for each="{flashMessages}" as="flashMessage">
-                       <li class="alert {flashMessage.class}">
-                               <h4><f:translate id="{flashMessage.title}" extensionName="beuser" /></h4>
-                               <f:translate id="{flashMessage.message}" extensionName="beuser" />
-                       </li>
-               </f:for>
-       </ul>
-</f:flashMessages>
-
 <f:render section="content" />
index 719b49a..5dcaf20 100644 (file)
@@ -14,13 +14,15 @@ namespace TYPO3\CMS\Core\Messaging;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * A class representing flash messages.
  */
 class FlashMessage extends AbstractMessage
 {
     /**
-     * defines whether the message should be stored in the session (to survive redirects) or only for one request (default)
+     * Defines whether the message should be stored in the session (to survive redirects) or only for one request (default)
      *
      * @var bool
      */
@@ -55,7 +57,6 @@ class FlashMessage extends AbstractMessage
      * @param string $title Optional message title.
      * @param int $severity Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
      * @param bool $storeInSession Optional, defines whether the message should be stored in the session or only for one request (default)
-     * @return void
      */
     public function __construct($message, $title = '', $severity = self::OK, $storeInSession = false)
     {
@@ -101,7 +102,7 @@ class FlashMessage extends AbstractMessage
      *
      * @return string The message severity icon name
      */
-    protected function getIconName()
+    public function getIconName()
     {
         return $this->icons[$this->severity];
     }
@@ -110,9 +111,11 @@ class FlashMessage extends AbstractMessage
      * Renders the flash message.
      *
      * @return string The flash message as HTML.
+     * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
      */
     public function render()
     {
+        GeneralUtility::logDeprecatedFunction();
         $title = '';
         if (!empty($this->title)) {
             $title = '<h4 class="alert-title">' . $this->title . '</h4>';
@@ -134,13 +137,4 @@ class FlashMessage extends AbstractMessage
                        </div>';
         return $message;
     }
-
-    /**
-     * Renders the flash message, makes it possible to render a flashMessage in a fluid view.
-     *
-     * @return string
-     */
-    public function __toString() {
-        return $this->render();
-    }
 }
index 45c1c76..65cc5c8 100644 (file)
@@ -37,6 +37,14 @@ class FlashMessageQueue extends \SplQueue
     }
 
     /**
+     * @return string
+     */
+    public function getIdentifier()
+    {
+        return $this->identifier;
+    }
+
+    /**
      * Adds a message either to the BE_USER session (if the $message has the storeInSession flag set)
      * or it enqueues the message.
      *
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-71249-DeprecateRenderMethodOfFlashMessageClass.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-71249-DeprecateRenderMethodOfFlashMessageClass.rst
new file mode 100644 (file)
index 0000000..48bf73b
--- /dev/null
@@ -0,0 +1,22 @@
+===================================================================
+Deprecation: #71249 - Deprecate render method of FlashMessage class
+===================================================================
+
+Description
+===========
+
+Method ``TYPO3\CMS\Core\Messaging\FlashMessage::render()`` has been deprecated.
+
+
+Affected Installations
+======================
+
+Instances with custom backend modules that use this method.
+
+
+Migration
+=========
+
+Use custom render code, the ``<f:flashMessage />`` ViewHelper or the ``ModuleTemplate`` for backend modules to render Flash Messages.
+It is suggested not to include HTML in flash messages. Flash messages should be short notifications on usr interactions.
+If you need more elaborate or persistent messages, use ``<f:be.infobox />`` view helper or HTML similar to that.
\ No newline at end of file
index 6488114..d59835d 100644 (file)
@@ -107,6 +107,7 @@ class DocumentController extends ActionController
             }
 
             $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
+            $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
         }
     }
 
index f3c0e8f..a5c707a 100644 (file)
@@ -1,9 +1,4 @@
 <div class="typo3-documentation">
        <f:render section="module-headline" />
-       <f:flashMessages as="flashMessages">
-               <f:for each="{flashMessages}" as="flashMessage">
-                       {flashMessage}
-               </f:for>
-       </f:flashMessages>
        <f:render section="Content" />
 </div>
index e470aa1..50a0194 100644 (file)
@@ -108,6 +108,7 @@ class AbstractModuleController extends AbstractController {
         }
 
         $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
+        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
     }
 
     /**
index 2dca273..6ec7227 100644 (file)
        }"
        />
 <f:render section="headline" />
-<f:flashMessages as="flashMessages">
-       <f:for each="{flashMessages}" as="flashMessage">
-               {flashMessage}
-       </f:for>
-</f:flashMessages>
 
 <f:render section="content" />
index 3be7866..00e0524 100644 (file)
@@ -7,7 +7,6 @@
 </f:section>
 
 <f:section name="content">
-       <f:flashMessages class="distribution-detail-flashmessage" />
        <div class="distribution-detail">
                <div class="distribution-detail-previewpane">
                        <em:image
index 3ed2957..93bbbcf 100644 (file)
@@ -7,12 +7,6 @@
 </f:section>
 
 <f:section name="content">
-       <f:flashMessages as="flashMessages">
-               <f:for each="{flashMessages}" as="flashMessage">
-                       {flashMessage}
-               </f:for>
-       </f:flashMessages>
-
        <f:render partial="List/UnresolvedDependencies" arguments="{_all}" />
        <f:be.infobox title="{f:translate(key: 'dependencyCheck.unresolvedDependencies.title')}" state="1">
                <f:render partial="List/UnresolvedDependenciesMessage" />
@@ -23,4 +17,4 @@
        <f:link.action action="installExtensionWithoutSystemDependencyCheck" controller="Action" arguments="{extensionKey: extension.extensionKey}" class="btn btn-default t3js-dependencies disabled onClickMaskExtensionManager">
                <span class="t3-icon t3-icon-actions t3-icon-dialog-error">&nbsp;</span> <f:translate key="dependencyCheck.unresolvedDependencies.proceed" />
        </f:link.action>
-</f:section>
+</f:section>
\ No newline at end of file
index 3cf7a5f..d0c3279 100644 (file)
@@ -1,12 +1,7 @@
 <f:render section="headline" />
-<f:flashMessages as="flashMessages" queueIdentifier="core.template.flashMessages">
-       <f:for each="{flashMessages}" as="flashMessage">
-               {flashMessage}
-       </f:for>
-</f:flashMessages>
 <f:render section="content" />
 
 <div class="t3js-drag-uploader" data-target-folder="{folderIdentifier}" data-progress-container="#typo3-filelist"
         data-dropzone-trigger=".t3js-drag-uploader-trigger" data-dropzone-target=".t3js-module-body h1:first"
         data-file-deny-pattern="{fileDenyPattern}" data-max-file-size="{maxFileSize}"
-       ></div>
+       ></div>
\ No newline at end of file
index 83a899b..406347a 100644 (file)
@@ -94,20 +94,6 @@ class FlashMessagesViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractT
     protected $tagName = 'ul';
 
     /**
-     * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-     */
-    protected $configurationManager;
-
-    /**
-     * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-     * @return void
-     */
-    public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
-    {
-        $this->configurationManager = $configurationManager;
-    }
-
-    /**
      * Initialize arguments
      *
      * @return void
index 80a6941..d5da4ba 100644 (file)
@@ -92,6 +92,7 @@ class AdministrationController extends ActionController
         $pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause);
         $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
         $this->generateMenu();
+        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
     }
 
     /**
index 3b255f5..7bdee92 100644 (file)
@@ -5,11 +5,6 @@
 
 <f:section name="Content">
        <p class="lead"><f:translate key="administration.document.description"/></p>
-       <f:flashMessages as="flashMessages">
-               <f:for each="{flashMessages}" as="flashMessage">
-                       {flashMessage}
-               </f:for>
-       </f:flashMessages>
        <f:if condition="{phashRow}">
                <f:then>
                        <table class="table table-striped table-hover">
 
                </f:form>
        </f:if>
-</f:section>
+</f:section>
\ No newline at end of file
index 7d588bb..de88559 100644 (file)
@@ -285,7 +285,7 @@ class LanguageController extends ActionController
         $menu->addMenuItem($languageListMenuItem);
         $menu->addMenuItem($translationMenuItem);
         $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
-
+        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
     }
 
     /**
index 96e0a13..5bf4132 100644 (file)
@@ -1,6 +1,5 @@
 {namespace core=TYPO3\CMS\Core\ViewHelpers}
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en"
       xmlns:f="http://xsd.helmut-hummel.de/ns/TYPO3/CMS/Fluid/ViewHelpers">
 <f:layout name="Default"/>
@@ -9,11 +8,6 @@
        <h1>
                <f:translate key="header.languages"/>
        </h1>
-       <f:flashMessages as="flashMessages">
-               <f:for each="{flashMessages}" as="flashMessage">
-                       {flashMessage}
-               </f:for>
-       </f:flashMessages>
        <form class="form-inline">
                <div class="form-group">
                        <f:form.textfield name="typo3-language-searchfield" placeholder="{f:translate(key:'table.search')}"
index a79c0f7..cf19d4e 100644 (file)
@@ -2,11 +2,6 @@
 
 <f:section name="content">
        <h1><f:translate key="header.translations" /></h1>
-       <f:flashMessages as="flashMessages">
-               <f:for each="{flashMessages}" as="flashMessage">
-                       {flashMessage}
-               </f:for>
-       </f:flashMessages>
        <form class="form-inline">
                <div class="form-group">
                        <f:form.textfield name="typo3-language-searchfield" placeholder="{f:translate(key:'table.search')}" id="typo3-language-searchfield" value="{search}" class="form-control t3js-language-searchfield" />
index 3cf6611..7a757db 100644 (file)
@@ -115,6 +115,7 @@ class RecyclerModuleController extends ActionController
         /** @var BackendTemplateView $view */
         parent::initializeView($view);
         $this->registerDocheaderButtons();
+        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
     }
 
     /**
index 2732da5..d3519f0 100644 (file)
@@ -1,8 +1,3 @@
 <f:be.pageRenderer includeRequireJsModules="{0:'TYPO3/CMS/Recycler/Recycler'}" />
 <h1><f:translate key="title" /></h1>
-<f:flashMessages as="flashMessages">
-       <f:for each="{flashMessages}" as="flashMessage">
-               {flashMessage}
-       </f:for>
-</f:flashMessages>
 <f:render section="content" />
index e23a615..f4eee94 100644 (file)
@@ -22,8 +22,6 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
-use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
-use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
@@ -167,21 +165,6 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         }
         $this->getButtons();
         $this->getModuleMenu();
-        $this->content = $this->getFlashMessages() . $this->content;
-    }
-
-    /**
-     * Get the default rendered FlashMessages from queue
-     *
-     * @return string
-     */
-    public function getFlashMessages()
-    {
-        /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
-        $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
-        /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
-        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
-        return $defaultFlashMessageQueue->renderFlashMessages();
     }
 
     /**
@@ -1499,13 +1482,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
      */
     public function addMessage($message, $severity = FlashMessage::OK)
     {
-        /** @var $flashMessage FlashMessage */
-        $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $message, '', $severity);
-        /** @var $flashMessageService FlashMessageService */
-        $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
-        /** @var $defaultFlashMessageQueue FlashMessageQueue */
-        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
-        $defaultFlashMessageQueue->enqueue($flashMessage);
+        $this->moduleTemplate->addFlashMessage($message, '', $severity);
     }
 
     /**
index 9ccd1ce..1212a92 100644 (file)
@@ -13460,12 +13460,6 @@ iframe {
 .distribution-meta .distribution-install {
   margin-top: 0.5em;
 }
-.distribution-detail-flashmessage {
-  margin-bottom: 2.5em;
-}
-.distribution-detail-flashmessage p {
-  padding-bottom: 0;
-}
 .distribution-detail {
   min-width: 750px;
 }
index aeefd51..960eb0e 100644 (file)
@@ -552,7 +552,7 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
         /** @var $flashMessageService FlashMessageService */
         $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
         /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
-        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier('module.template.flashmessages');
+        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
         $defaultFlashMessageQueue->enqueue($flashMessage);
     }
 
index 5081485..e93c67b 100644 (file)
@@ -43,6 +43,7 @@ class PreviewController extends AbstractController
     {
         parent::initializeView($view);
         $view->getModuleTemplate()->getDocHeaderComponent()->disable();
+        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
     }
 
     /**
index 1dd5e6f..fefac8d 100644 (file)
@@ -34,6 +34,7 @@ class ReviewController extends AbstractController
     {
         parent::initializeView($view);
         $this->registerButtons();
+        $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
     }
 
     /**
index b5a215a..d480d8d 100644 (file)
@@ -1,9 +1,4 @@
 <f:if condition="{pageTitle}"><h1>{pageTitle}</h1></f:if>
-<f:flashMessages as="flashMessages">
-       <f:for each="{flashMessages}" as="flashMessage">
-               {flashMessage}
-       </f:for>
-</f:flashMessages>
 <div id="workspacetabs"></div>
 <div class="well well-sm"><f:render section="main" /></div>
-<f:if condition="{showLegend}"><f:render partial="legend" /></f:if>
+<f:if condition="{showLegend}"><f:render partial="legend" /></f:if>
\ No newline at end of file
index 3bc0693..18efefc 100644 (file)
@@ -2,13 +2,6 @@
        <!-- Content of module, for instance listing, info or editing -->
        <div id="typo3-docbody">
                <div id="typo3-inner-docbody">
-
-                       <f:flashMessages as="flashMessages">
-                               <f:for each="{flashMessages}" as="flashMessage">
-                                       {flashMessage}
-                               </f:for>
-                       </f:flashMessages>
-
                        <f:render section="main"/>
                </div>
        </div>