Problem/Motivation

In #3589108: Refactor DeprecationHandler into a standard PHPUnit extension, a deprecation warning was added in \Drupal\Tests\DrupalTestCaseTrait::checkLegacySymfonyDeprecationHelperEnvVariable() if the SYMFONY_DEPRECATIONS_HELPER environment variable is present.
This warning is even triggered if the new DRUPAL_DEPRECATION_FILTER_CONFIG variable, the new way of configuring the deprecation helper, is present. This makes it harder for contrib module to support both Drupal 11.5+ and older Drupal versions with the same code. (They either need to ignore the deprecation warning or set the env vars conditionally.)

Steps to reproduce

In a contrib module, define a deprecation ignore file in both the old and the new way.

Proposed resolution

My proposal would be to not emit the warning if the DRUPAL_DEPRECATION_FILTER_CONFIG env var is present. This would make it much easier for contrib modules to be compatible with both.

It is also how we handled other deprecations in the past: For instance, if a plugin uses both annotations and attributes, no deprecation warning is triggered.

Remaining tasks

  • Decide whether this is intended behavior or whether it should be changed.
  • In the latter case, merge the MR.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

Issue fork drupal-3614295

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Status: Active » Needs review

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.