[BUGFIX] Do not turn E_USER_DEPRECATED errors into exceptions 67/54467/2
authorMarkus Klein <markus.klein@typo3.org>
Mon, 23 Oct 2017 16:12:35 +0000 (18:12 +0200)
committerBenni Mack <benni@typo3.org>
Fri, 27 Oct 2017 15:10:03 +0000 (17:10 +0200)
Also use the silent upgrade wizard to correct existing settings.

Resolves: #82721
Releases: master
Change-Id: I8d163799cf0d1acfaaa9c2589a70b932144b6dc6
Reviewed-on: https://review.typo3.org/54467
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Claus Due <claus@phpmind.net>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Error/ErrorHandler.php
typo3/sysext/install/Classes/Configuration/Context/DebugPreset.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php

index 3299abf..80885d9 100644 (file)
@@ -115,7 +115,6 @@ class ErrorHandler implements ErrorHandlerInterface, LoggerAwareInterface
             case E_RECOVERABLE_ERROR:
                 $severity = 2;
                 break;
-            case E_USER_DEPRECATED:
             case E_USER_WARNING:
             case E_WARNING:
                 $severity = 1;
index e81f3fd..23ffaaf 100644 (file)
@@ -40,8 +40,8 @@ class DebugPreset extends Configuration\AbstractPreset
         'SYS/devIPmask' => '*',
         'SYS/displayErrors' => 1,
         'SYS/systemLogLevel' => 0,
-        // E_WARNING | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED
-        'SYS/exceptionalErrors' => 28674,
+        // E_WARNING | E_RECOVERABLE_ERROR | E_DEPRECATED
+        'SYS/exceptionalErrors' => 12290,
     ];
 
     /**
index 5837868..39a5221 100644 (file)
@@ -146,6 +146,7 @@ class SilentConfigurationUpgradeService
         $this->migrateDatabaseDriverOptions();
         $this->migrateLangDebug();
         $this->migrateCacheHashOptions();
+        $this->migrateExceptionErrors();
 
         // Should run at the end to prevent that obsolete settings are removed before migration
         $this->removeObsoleteLocalConfigurationSettings();
@@ -861,4 +862,21 @@ class SilentConfigurationUpgradeService
             $this->throwConfigurationChangedException();
         }
     }
+
+    /**
+     * Migrate SYS/exceptionalErrors to not contain E_USER_DEPRECATED
+     */
+    protected function migrateExceptionErrors()
+    {
+        $confManager = $this->configurationManager;
+        try {
+            $currentOption = (int)$confManager->getLocalConfigurationValueByPath('SYS/exceptionalErrors');
+            // make sure E_USER_DEPRECATED is not part of the exceptionalErrors
+            if ($currentOption & E_USER_DEPRECATED) {
+                $confManager->setLocalConfigurationValueByPath('SYS/exceptionalErrors', $currentOption & ~E_USER_DEPRECATED);
+            }
+        } catch (\RuntimeException $e) {
+            // no change inside the LocalConfiguration.php found, so nothing needs to be modified
+        }
+    }
 }