Problem/Motivation

The condition plugin stores its settings under the "bundles" key, but the module ships no configuration schema for them. Drupal expects every piece of configuration to be described by a schema, and without one several things break quietly.

Configuration that has no schema cannot be validated, cannot be translated, and cannot be cast to the right data types when it is read back. More immediately, strict configuration schema checking is enabled by default in Drupal's test base classes, so any test that saves a block using this condition fails with a schema error before it can assert anything. That makes it impossible to add test coverage for the plugin until the schema exists.

Steps to reproduce

1. Enable the module.
2. Edit any block and enable the "Paragraph type" visibility condition.
3. Save the block.
4. The stored condition settings are not covered by any schema definition.

Proposed resolution

Add config/schema/paragraphs_condition.schema.yml declaring condition.plugin.paragraph_type. It extends the condition.plugin base type provided by Drupal core, which already covers the "id" and "negate" keys, and adds "bundles" as a sequence of strings holding the selected paragraph type IDs.

Comments

trebormc created an issue. See original summary.

  • trebormc committed 24c7d2d5 on 1.0.x
    Issue #3618975 by trebormc: Add config schema for the condition plugin.
    
trebormc’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.