[BUGFIX] Don’t show deprecations as "success" flash messages 02/55202/2
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 13:39:08 +0000 (14:39 +0100)
Change-Id: I48eba81412e314bb8ee013ef38ecbdb32a14ed96
Resolves: #83416
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/55202
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Reiner Teubner <rteubner@me.com>
Tested-by: Reiner Teubner <rteubner@me.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/core/Classes/Error/ErrorHandler.php

index 80885d9..27f0c9a 100644 (file)
@@ -18,6 +18,7 @@ use Psr\Log\LoggerAwareInterface;
 use Psr\Log\LoggerAwareTrait;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Log\LogLevel;
+use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\TimeTracker\TimeTracker;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -113,13 +114,16 @@ class ErrorHandler implements ErrorHandlerInterface, LoggerAwareInterface
         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:
+                $flashMessageSeverity = FlashMessage::WARNING;
                 $severity = 1;
                 break;
             default:
+                $flashMessageSeverity = FlashMessage::NOTICE;
                 $severity = 0;
         }
         $logTitle = 'Core: Error handler (' . TYPO3_MODE . ')';
@@ -150,7 +154,7 @@ class ErrorHandler implements ErrorHandlerInterface, LoggerAwareInterface
                         \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);