Problem/Motivation

PluginManagerPass:

      if (str_starts_with($service_id, 'plugin.manager.') && !$definition->hasTag('plugin_manager_cache_clear')) {
        if (is_subclass_of($definition->getClass(), '\Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface')) {
          $definition->addTag('plugin_manager_cache_clear');
        }
      }

but then we also have some manually configured services:

config.typed:
  class: Drupal\Core\Config\TypedConfigManager
  tags:
    - { name: plugin_manager_cache_clear }

entity_type.manager:
  class: Drupal\Core\Entity\EntityTypeManager
  tags:
    - { name: plugin_manager_cache_clear }

typed_data_manager:
   class: Drupal\Core\TypedData\TypedDataManager
   tags:
     - { name: plugin_manager_cache_clear }

Each of those services implements CachedDiscoveryInterface, which CachedDiscoveryClearer is in charge of calling.

Steps to reproduce

Proposed resolution

Autoconfigure the tag in CoreServiceProvider:

    $container->registerForAutoconfiguration(CachedDiscoveryInterface::class)
      ->addTag('plugin_manager_cache_clear');

Then remove deprecate PluginManagerPass and the manual tags.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3582521

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

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

longwave’s picture

Status: Needs review » Needs work

Hm, this will need BC for contrib though.

longwave’s picture

Issue summary: View changes
Issue tags: +Needs change record

stborchert made their first commit to this issue’s fork.

stborchert’s picture

Status: Needs work » Needs review

As far as I can tell there is not much to do for BC:

* manually added tags (plugin_manager_cache_clear are still working
* existing services without the tag but subclassing CachedDiscoveryInterface are still autoconfigured (but will get a deprecation warning)

Am I missing something?

smustgrave’s picture

Status: Needs review » Needs work

We've missed the 11.5 window. Earliest now is 12.1.0 but they'll need to point to a CR also.

stborchert’s picture

Status: Needs work » Needs review

Updated the version in the deprecation message and added a change notice.

smustgrave’s picture

@longwave thoughts on the current MR?

May be above me to fully review it, least to move it forward.