Task #82438

Use native trigger_error and ErrorHandler for deprecations

Added by Benni Mack about 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
System/Bootstrap/Configuration
Target version:
Start date:
2017-09-10
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Sprint Focus:

Related issues

Related to TYPO3 Core - Bug #82676: Resolve TCA deprecations in functional test fixture extensions Closed 2017-10-04
Related to TYPO3 Core - Task #82684: bamboo: Execute deprecated unit tests Closed 2017-10-05
Related to TYPO3 Core - Bug #82720: Install Tool must not fail on deprecations Closed 2017-10-10
Related to TYPO3 Core - Task #82721: Improve documentation of new deprecation strategy Closed 2017-10-10
Related to TYPO3 Core - Bug #87960: No way to disable deprecation message logged to file New 2019-03-20

Associated revisions

Revision 6f20a279 (diff)
Added by Christian Kuhn about 2 years ago

[TASK] Raise typo3/testing-framework to 1.1.4

The raise brings an additional UnitTestsDeprecated.xml
setup file dedicated to test deprecated core functionality.

Change-Id: Ic61ce2d76ed7f4e83bc6c2a12dd1337392d6c4aa
Resolves: #82437
Related: #82438
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54096
Reviewed-by: Markus Hölzle <>
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 4c368b34 (diff)
Added by Christian Kuhn about 2 years ago

[TASK] Raise typo3/testing-framework to 1.1.4

The raise brings an additional UnitTestsDeprecated.xml
setup file dedicated to test deprecated core functionality.

Change-Id: Ic61ce2d76ed7f4e83bc6c2a12dd1337392d6c4aa
Resolves: #82437
Related: #82438
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54100
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 2d95e831 (diff)
Added by Benni Mack about 2 years ago

[BUGFIX] TCA deprecations in functional test fixture extensions

Change-Id: I136ee199ca80a9bc749de4f93950f84a10148a00
Resolves: #82676
Related: #82438
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54292
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 5fcf2392 (diff)
Added by Benni Mack about 2 years ago

[BUGFIX] TCA deprecations in functional test fixture extensions

Change-Id: I136ee199ca80a9bc749de4f93950f84a10148a00
Resolves: #82676
Related: #82438
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54293
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 95b13dca (diff)
Added by Benni Mack about 2 years ago

[!!!][TASK] Use native trigger_error and ErrorHandler for deprecations

The native PHP way of triggering deprecations by a framework or
applications is done via
`trigger_error($deprecationMessage, E_USER_DEPRECATED)`.

Previously, TYPO3 used `GeneralUtility::deprecationLog()` and
similar methods to generate a custom deprecation log, however it's
more flexible to use native logging through TYPO3's ErrorHandler.

This solution centralizes the way to configure the place if and
how deprecation logs should be written to various log destinations.

This also changes the way how deprecated methods, arguments and classes
are handled.

The new way to deprecate code in TYPO3 is done via
`trigger_error()`, the @deprecated annotation within a method only
exists now for IDE support, but is not reflected anymore for the
logging message.
That's why the @deprecated annotation does not contain
a description anymore.

The methods
GeneralUtility::logDeprecatedFunction()
GeneralUtility::deprecationLog()
GeneralUtility::getDeprecationLogFileName()
GeneralUtility::logDeprecatedViewHelperAttribute()

are marked as deprecated from now on.

The configuration option $TYPO3_CONF_VARS[SYS][enableDeprecationLog]
is removed.

Deprecation messages can now be activated by adding
the E_USER_DEPRECATED constant to the respective values in

$TYPO3_CONF_VARS[SYS][errorHandlerErrors]
(so exceptions are handled by the TYPO3 error handler)
$TYPO3_CONF_VARS[SYS][syslogErrorReporting]
(so exceptions are put into GeneralUtility::sysLog)
$TYPO3_CONF_VARS[SYS][belogErrorReporting]
(so exceptions are put into sys_log DB table)
$TYPO3_CONF_VARS[SYS][exceptionalErrors]
(so exceptions are thrown on a deprecation)

Deprecations will still go into GeneralUtility::devLog(),
if deprecations are activated via the "errorHandlerErrors" option.

Tests which test explicitly for deprecated code is moved into
Tests/UnitDeprecated, to ensure that the deprecated code is not
throwing an exception.

Resolves: #82438
Releases: master
Change-Id: I6ef9a642d179001f0484c4c7678e0bec12284faf
Reviewed-on: https://review.typo3.org/54015
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 77621bdd (diff)
Added by Benni Mack about 2 years ago

[FOLLOWUP][TASK] Use native trigger_error and ErrorHandler for deprecations

The patch added a superfluous switch/case entry which is unnecessary.

Resolves: #82438
Releases: master
Change-Id: Ib2ac2503fa3ccb8ce2605e95163a29062a71cb8a
Reviewed-on: https://review.typo3.org/54297
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

Revision 8fb35438 (diff)
Added by Christian Kuhn about 2 years ago

[TASK] bamboo: Execute deprecated unit tests

Add execution of the deprecated unit tests to bamboo.

Change-Id: I5b15448250f3158fde6dad3ec2c3f2681edb0b49
Resolves: #82684
Related: #82438
Releases: master
Reviewed-on: https://review.typo3.org/54302
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Gerrit Code Review about 2 years ago

  • Status changed from New to Under Review

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#2 Updated by Gerrit Code Review about 2 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#3 Updated by Gerrit Code Review about 2 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#4 Updated by Gerrit Code Review about 2 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#5 Updated by Gerrit Code Review about 2 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#6 Updated by Gerrit Code Review about 2 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#7 Updated by Gerrit Code Review about 2 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#8 Updated by Gerrit Code Review about 2 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#9 Updated by Gerrit Code Review about 2 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#10 Updated by Gerrit Code Review about 2 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#11 Updated by Gerrit Code Review about 2 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#12 Updated by Gerrit Code Review about 2 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#13 Updated by Gerrit Code Review about 2 years ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#14 Updated by Gerrit Code Review about 2 years ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#15 Updated by Gerrit Code Review about 2 years ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#16 Updated by Gerrit Code Review about 2 years ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#17 Updated by Gerrit Code Review about 2 years ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#18 Updated by Gerrit Code Review about 2 years ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#19 Updated by Christian Kuhn about 2 years ago

  • Related to Bug #82676: Resolve TCA deprecations in functional test fixture extensions added

#20 Updated by Gerrit Code Review about 2 years ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#21 Updated by Gerrit Code Review about 2 years ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#22 Updated by Gerrit Code Review about 2 years ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#23 Updated by Gerrit Code Review about 2 years ago

Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54015

#24 Updated by Benni Mack about 2 years ago

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

#25 Updated by Gerrit Code Review about 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54297

#26 Updated by Benni Mack about 2 years ago

  • Status changed from Under Review to Resolved

#27 Updated by Christian Kuhn about 2 years ago

  • Related to Task #82684: bamboo: Execute deprecated unit tests added

#28 Updated by Georg Ringer about 2 years ago

  • Related to Bug #82720: Install Tool must not fail on deprecations added

#29 Updated by Georg Ringer about 2 years ago

  • Related to Task #82721: Improve documentation of new deprecation strategy added

#30 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

#31 Updated by Markus Klein 7 months ago

  • Related to Bug #87960: No way to disable deprecation message logged to file added

Also available in: Atom PDF