Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294951

Adopt PluginExists validator in relevant places

$
0
0

Problem/Motivation

#2920682: Add config validation for plugin IDs added the PluginExists constraint and used it in 2 places in config schema (see #2920682: Add config validation for plugin IDs):

  • 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
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

All of these are addressed in this issue.

There are some 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

plugin.manager.views.display_extender
In patchplugin.manager.views.field
In patchplugin.manager.views.filter
N/Aplugin.manager.views.join
In patchplugin.manager.views.pager
In patchplugin.manager.views.queryviews_display.
In patchplugin.manager.views.relationshipviews_relationship.
In patchplugin.manager.views.rowviews_display.
In patchplugin.manager.views.sort
In patchplugin.manager.views.styleviews_display.
N/Aplugin.manager.views.wizard
In patchplugin.manager.workflows.typeworkflows.workflow.*\Drupal\workflows\WorkflowTypeInterface

Steps to reproduce

Proposed resolution

  1. Adopt it in all relevant places.
  2. Write test that verifies that all default config in Drupal core complies with the validation constraints, by adding a new testValidity() method to \Drupal\KernelTests\Core\Config\DefaultConfigTest

Viewing all articles
Browse latest Browse all 294951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>