Problem/Motivation

The Button Formatter module currently ships incomplete and invalid configuration schema definitions.

On Drupal 10.3+ and Drupal 11, strict configuration schema validation reports errors for the module because the formatter settings schema contains an invalid type declaration, a missing stored setting, and a malformed key. In addition, the module provides a global configuration object, button_formatter.settings, but does not define any schema for it.

This affects sites using the Button Formatter field formatter and its global settings, because saving field display configuration can trigger invalid configuration schema warnings. These warnings make it harder to validate site configuration reliably and can affect projects that enforce strict configuration schema correctness.

Steps to reproduce

  1. Install the Button Formatter module on Drupal 10.3+ or Drupal 11.
  2. Add or edit a file or link field on an entity bundle.
  3. Go to the entity display settings, for example Manage display.
  4. Select Button Formatter as the formatter for the field.
  5. Configure formatter options such as custom label, open in new tab, icon display, or external link behaviour.
  6. Save the display configuration.
  7. Observe invalid configuration schema warnings when the formatter configuration is saved, including the invalid boolran type, the missing schema for is_external, and the malformed radius:: schema key.
  8. Configure and save the module global settings.
  9. Observe additional schema warnings because the button_formatter.settings configuration object has no schema definition.

Proposed resolution

Update config/schema/button_formatter.schema.yml so that the schema matches the configuration actually provided and stored by the module.

  • Fix the invalid show_custom_label schema type from boolran to boolean.
  • Add the missing is_external formatter setting as a boolean.
  • Fix the malformed radius:: formatter schema key to radius.
  • Add a top-level button_formatter.settings schema definition using config_object.
  • Define styles, sizes, and radius as sequences of strings, matching the install configuration and settings form behaviour.
  • Define global_class and external_link as strings.

This resolves the schema validation warnings by ensuring both the formatter configuration and the global module configuration have valid and complete schema definitions.

Remaining tasks

Review the merge request.

User interface changes

None.

API changes

None.

Data model changes

None.

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

lolgm created an issue. See original summary.

lolgm’s picture

Status: Active » Needs work

MR !7 implements the proposed solution in this issue.

lolgm’s picture

Status: Needs work » Needs review
david.muffley’s picture

Status: Needs review » Reviewed & tested by the community

I found the same issues as mentioned in the IS and see that the MR resolves the issues.

Validated with https://www.drupal.org/project/config_inspector, as well as by resaving the affected my configs and seeing the changed exported config files.