condition_info_alter deprecation triggers false possitive deprecation notices

Created on 6 December 2022, about 2 years ago
Updated 2 June 2023, over 1 year ago

Problem/Motivation

  // Drupal 9.x only: override core node_type with ctools constraints.
  if (isset($definitions['node_type']) && $definitions['node_type']['class'] == 'Drupal\node\Plugin\Condition\NodeType') {
    @trigger_error('\Drupal\node\Plugin\Condition\NodeType is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Entity\Plugin\Condition\EntityBundle instead. See https://www.drupal.org/node/2983299', E_USER_DEPRECATED);
    $definitions['node_type']['class'] = NodeType::class;
  }

This triggers a deprecation on ever plugin cache rebuild regardless of if the plugin is actually used because the _definition_ exists. This isn't actually useful those and will lead developers down a rabbit hole looking for usages of the plugin.

Since the NodeType use's core's constructor, any uses of the plugin will appropriately trigger the deprecation notice so this trigger can safely be removed.

Steps to reproduce

Run a test on a site with ctools installed but no condition plugin usage. See deprecation messages for unused plugin.

Proposed resolution

Remove the deprecation trigger error.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024