[BUGFIX] Don’t show deprecations as "success" flash messages 43/55243/3
authorAndreas Wolf <dev@a-w.io>
Fri, 22 Dec 2017 16:06:52 +0000 (17:06 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Tue, 2 Jan 2018 14:03:52 +0000 (15:03 +0100)
Change-Id: I48eba81412e314bb8ee013ef38ecbdb32a14ed96
Resolves: #83416
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/55243
Reviewed-by: Reiner Teubner <rteubner@me.com>
Tested-by: Reiner Teubner <rteubner@me.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/core/Classes/Error/ErrorHandler.php

index b6da1de..28b0eba 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Core\Error;
  */
 
 use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\TimeTracker\TimeTracker;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -108,14 +109,17 @@ class ErrorHandler implements ErrorHandlerInterface
         switch ($errorLevel) {
             case E_USER_ERROR:
             case E_RECOVERABLE_ERROR:
+                // no $flashMessageSeverity, as there will be no flash message for errors
                 $severity = 2;
                 break;
             case E_USER_WARNING:
             case E_WARNING:
             case E_USER_DEPRECATED:
+                $flashMessageSeverity = FlashMessage::WARNING;
                 $severity = 1;
                 break;
             default:
+                $flashMessageSeverity = FlashMessage::NOTICE;
                 $severity = 0;
         }
         $logTitle = 'Core: Error handler (' . TYPO3_MODE . ')';
@@ -152,7 +156,7 @@ class ErrorHandler implements ErrorHandlerInterface
                         \TYPO3\CMS\Core\Messaging\FlashMessage::class,
                         $message,
                         $errorLevels[$errorLevel],
-                        $severity
+                        $flashMessageSeverity
                     );
             /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
             $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);