Problem/Motivation

\Drupal\options\Plugin\Field\FieldType\ListItemBase::extractAllowedValues is triggering a non-silenced deprecation message.

Proposed resolution

Silence the deprecation message with @.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3406971

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

lauriii created an issue. See original summary.

lauriii’s picture

Status: Active » Reviewed & tested by the community
poker10’s picture

Status: Reviewed & tested by the community » Needs review

There seems to be other non-silenced deprecation message, for example Drupal\Component\Assertion\Handle:

trigger_error(__NAMESPACE__ . '\Handle is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Instead, use assert_options(ASSERT_EXCEPTION, TRUE). See https://www.drupal.org/node/3105918', E_USER_DEPRECATED);

Wouldn't it be better to expand the scope to search/fix also others, if there are any left? Or is it OK to fix just this one? Thanks!

smustgrave’s picture

Status: Needs review » Needs work

There are actually dozens of these, several in the stream wrapper folder. Not sure if we want to do all at once but definitely think we could group a few together.

Always wondered why we request deprecation tests and now I know :) haha

spokje’s picture

Wouldn't it be better to expand the scope to search/fix also others, if there are any left? Or is it OK to fix just this one? Thanks!

Got nerd-sniped and wondered if coder could help us here.
I think it can: https://git.drupalcode.org/issue/drupal-3390360/-/jobs/481429

So I believe there are only two, both mentioned in this issue.

There are actually dozens of these, several in the stream wrapper folder. Not sure if we want to do all at once but definitely think we could group a few together.

Those are unsilenced trigger_error('yadada', E_USER_WARNING); which is ok, we're after unsilenced trigger_error('blahblah', E_USER_DEPRECATED);, the difference being the last argument E_USER_DEPRECATED.

Now this coder change is a complete hack, would need a separate rule and tests, but it's basically a small change: https://github.com/pfrenssen/coder/compare/8.3.x...Boegie:coder:mustsupr...

Should we open an issue in coder, add an actual polished rule with tests and solve both (then) PHPCS fails when that rule is approved, committed, coder is released, coder version is bumped in core?

spokje’s picture

Opened #3412078: Add sniff for unsilenced deprecation warnings, just because the code was basically already there.

spokje’s picture

#3412078: Add sniff for unsilenced deprecation warnings just got committed, we're waiting for the next release of coder

Spokje changed the visibility of the branch 3406971-coder-rule to hidden.

Spokje changed the visibility of the branch 11.x to hidden.

Spokje changed the visibility of the branch 3406971-non-silenced-deprecation-message to hidden.

Spokje changed the visibility of the branch 10.4.x to hidden.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Status: Needs work » Closed (outdated)

#3443206: Remove deprecated code from search and options modules deprecations here were removed before D11 so believe this can be closed out. Am assigning credit for the initial work though.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.