Problem/Motivation

If you store a plugin in config (e.g. via LazyPluginCollection, see EntityWithPluginCollectionInterface), if plugin IDs have a . in them there will be validation errors preventing the config from saving.

Steps to reproduce

@todo

Proposed resolution

DefaultPluginManager can warn when plugin IDs have . in them.

Remaining tasks

  1. Write steps to reproduce
  2. Decide on wording
  3. Decide on error type (E_USER_WARNING vs E_USER_DEPRECATED)?
  4. Write tests
  5. Write CR

User interface changes

N/A

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

Issue fork drupal-3215662

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

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review

Posted preliminary MR.

wim leers’s picture

👏

tim.plunkett’s picture

7 out of 44 core plugin managers currently have core implementations with dots in their IDs. They are also definitely not ones you would store in config:
TypedData
Local Actions
Local Tasks
Contextual Links
ConfigMapper (config_translation)
Help Topics
Breakpoints

I was surprised at that last one since they literally are stored in config, but breakpoints don't use plugin collections like other more modern modules, so they only store the plugin IDs as values, never keys.

This is ready for a preliminary review, but still needs the STR and tests.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work

Can you update the MR for 10.1 please

Also there is a @todo in the IS you can fill that in.

Thanks!

tim.plunkett’s picture

Updated branch.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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.