Skip to content
Snippets Groups Projects
Commit 151b56f4 authored by Robert Vock's avatar Robert Vock Committed by Jigal van Hemert
Browse files

[BUGFIX] Logging PHP errors to sys_log table does not work

Logging PHP errors stopped working after changeset
3e309294 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
parent 5adfc5f4
Branches
Tags
No related merge requests found
......@@ -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'])) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment