Bug #83770
closedErrorHandler is not triggered after first error anymore
100%
Description
Prerequisites:
- set some initCommands for your database connection
Given:
- some functional test that triggers deprecated functions in 9.0 and above
- the deprecated function triggers an error (using trigger_error) of kind E_USER_DEPRECATED
Actual:
- running the functional test ends up with an error and the deprecation message (https://review.typo3.org/#/c/55548/3 and https://travis-ci.org/TYPO3-Solr/ext-solr/jobs/336002964)
Expected:
- the deprecation error should be caught by the \TYPO3\CMS\Core\Error\ErrorHandler and not trigger any "real" error
Analysis:
- everything works as expected if no initCommands are configured for the current database connection
- if initCommands are configured, the connection is prepared with those commands and therefore connected
- the \TYPO3\CMS\Core\Error\ErrorHandler tries to write deprecation messages into sys_log by calling \TYPO3\CMS\Core\Error\ErrorHandler::writeLog
- writeLog fetches a database connection (still inside the ErrorHandler) that is opened by default (due to the configured initCommands)
- \Doctrine\DBAL\Driver\Mysqli\MysqliConnection sets and restores own php error handler in its __construct function (still in \TYPO3\CMS\Core\Error\ErrorHandler)
-> resetting an error handler inside another error handler causes weird behaviour and seems to remove the \TYPO3\CMS\Core\Error\ErrorHandler as well
Solution:
- we have to prevent to open connections by default if initCommands for a connections are configured
- those commands only need to be executed after the connection is really forces to be connected (opened)
Updated by Gerrit Code Review almost 7 years ago
- Status changed from New to Under Review
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55548
Updated by Gerrit Code Review almost 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55548
Updated by Gerrit Code Review almost 7 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55548
Updated by Gerrit Code Review almost 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55558
Updated by Nicole Cordes almost 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6fbefa628fb9cd52f8a8e7c0f0ec87bdb88c3b4f.
Updated by Gerrit Code Review almost 7 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55558
Updated by Gerrit Code Review almost 7 years ago
Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55558
Updated by Gerrit Code Review almost 7 years ago
Patch set 4 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55558
Updated by Nicole Cordes almost 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset 6269d46a4a4ec2f3f8f7cd142b38d10fe476e695.