[BUGFIX] Logging PHP errors to sys_log table does not work 66/22166/3
authorRobert Vock <robertvock82@gmail.com>
Tue, 9 Jul 2013 20:09:08 +0000 (22:09 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Tue, 9 Jul 2013 21:22:32 +0000 (23:22 +0200)
Logging PHP errors stopped working after changeset
3e309294309458279eef2adf08af6adb8ed4a867 when the  DatabaseConnection
class was changed.
The changed line tries to determine, if a database connection is
available and only writes the log entry if the connection was
already established.

Resolves: #49645
Releases: 6.1, 6.2
Change-Id: Idee413ed911a8c2d23f034ceadd17c955c98a337
Reviewed-on: https://review.typo3.org/22166
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/core/Classes/Error/ErrorHandler.php

index c9b47f4..cdc7be9 100644 (file)
@@ -167,7 +167,7 @@ class ErrorHandler implements \TYPO3\CMS\Core\Error\ErrorHandlerInterface {
         * @return void
         */
        protected function writeLog($logMessage, $severity) {
-               if (is_object($GLOBALS['TYPO3_DB']) && !empty($GLOBALS['TYPO3_DB']->link)) {
+               if (is_object($GLOBALS['TYPO3_DB']) && $GLOBALS['TYPO3_DB']->isConnected()) {
                        $userId = 0;
                        $workspace = 0;
                        if (is_object($GLOBALS['BE_USER'])) {