Bug #83770

ErrorHandler is not triggered after first error anymore

Added by Nicole Cordes over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2018-02-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

#1

Updated by Gerrit Code Review over 3 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

#2

Updated by Gerrit Code Review over 3 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

#3

Updated by Helmut Hummel over 3 years ago

  • Description updated (diff)
#4

Updated by Gerrit Code Review over 3 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

#5

Updated by Gerrit Code Review over 3 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

#6

Updated by Nicole Cordes over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#7

Updated by Gerrit Code Review over 3 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

#8

Updated by Gerrit Code Review over 3 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

#9

Updated by Gerrit Code Review over 3 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

#10

Updated by Nicole Cordes over 3 years ago

  • Status changed from Under Review to Resolved
#11

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF