Adopt PluginExists validator in relevant places

Created on 11 January 2023, almost 2 years ago
Updated 23 February 2024, 10 months ago

Problem/Motivation

Add config validation for plugin IDs Fixed added the PluginExists constraint and used it in 2 places in config schema:

  • block.block.*:plugin
  • editor.editor.*:editor

There are many more places in schema where we need to use this -- any place, really, where a plugin ID is mentioned in config. Right now, we're missing:

  • system.action*:plugin
  • condition.plugin:id
  • layout_builder.section:layout_id
  • field.field_settings.entity_reference:handler (needs further work in 🐛 [PP-1] Entity reference fields' config schema should not be allowed to refer to the fallback selection plugin Postponed )
  • field_config_base:field_type
  • field.storage.*.*:type
  • field_formatter:type
  • core.entity_form_display.*.*.*:content.*.type
  • filter:id
  • image.style.*:effects.*.id
  • system.mail:interface.*
  • media.type.*:source
  • rest.resource.*:plugin_id
  • search.page.*:plugin
  • tour.tip:plugin
  • views_display:access.type
  • views_area:plugin_id
  • views_argument:plugin_id
  • views_argument:default_argument_type
  • views_argument:validate.type
  • views_cache:type
  • views.view.*:display.*.display_plugin
  • views_display:exposed_form.type
  • views_field:plugin_id
  • views_filter:plugin_id
  • views_display:pager.type
  • views_display:query.type
  • views_relationship:plugin_id
  • views_display:row.type
  • views_sort:plugin_id
  • views_display:style.type
  • workflows.workflow.*:type

All of these are addressed in this issue.

There are also many plugin types which we can ignore in this issue, because they aren't used anywhere in config. Those are:

  • \Drupal\Core\Archiver\ArchiverInterface
  • \Drupal\ckeditor5\Plugin\CKEditor5PluginInterface
  • \Drupal\config_translation\ConfigMapperInterface
  • \Drupal\Core\Display\VariantInterface
  • \Drupal\Core\Render\Element\ElementInterface
  • \Drupal\help\HelpSectionPluginInterface
  • \Drupal\help\HelpTopicPluginInterface
  • \Drupal\language\LanguageNegotiationMethodInterface
  • \Drupal\layout_builder\SectionStorageInterface
  • \Drupal\Core\Http\LinkRelationTypeInterface
  • \Drupal\Core\Menu\ContextualLinkInterface
  • \Drupal\Core\Menu\MenuLinkInterface
  • \Drupal\Core\Menu\LocalActionInterface
  • \Drupal\Core\Menu\LocalTaskInterface
  • \Drupal\migrate\Plugin\MigrateDestinationInterface
  • \Drupal\migrate_drupal\Plugin\MigrateFieldInterface
  • \Drupal\migrate\Plugin\MigrateIdMapInterface
  • \Drupal\migrate\Plugin\MigrateProcessInterface
  • \Drupal\migrate\Plugin\MigrateSourceInterface
  • \Drupal\migrate\Plugin\MigrationInterface
  • \Drupal\Core\Queue\QueueWorkerInterface
  • \Drupal\views\Plugin\views\join\JoinPluginInterface
  • \Drupal\views\Plugin\views\wizard\WizardInterface

There is one Views plugin type, \Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase, which is not addressed by this issue because it is not used anywhere in core, so it's unclear how, or if, these plugin IDs are stored in config. We'll deal with this in 🐛 [PP-1] How should we validate Views display extenders in config schema? Postponed .

Proposed resolution

Adopt it in all relevant places, ensuring there is explicit test coverage that all parts of config (including config entities) which store plugin IDs, are validating those plugin IDs.

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Configuration 

Last updated 1 day ago

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

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