Issue Bug Closed

#49645Logging PHP errors to sys_log table does not work

Robert Vock 07/03/13, 16:57 updated 10/02/18, 12:12

Description

The default error handler does not write PHP errors to the sys_log table anymore.

The bug was introduced in changeset 3e309294309458279eef2adf08af6adb8ed4a867 when the link property of the DatabaseConnection was changed from public to private.

The TYPO3\CMS\Core\Error\ErrorHandler has a check for the link property which now returns false:

171         if (is_object($GLOBALS['TYPO3_DB']) && !empty($GLOBALS['TYPO3_DB']->link)) {

The one-liner fix would be to use the new method isConnected():

171         if (is_object($GLOBALS['TYPO3_DB']) && $GLOBALS['TYPO3_DB']->isConnected()) {

Reviews 3