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
- Install the Button Formatter module on Drupal 10.3+ or Drupal 11.
- Add or edit a file or link field on an entity bundle.
- Go to the entity display settings, for example
Manage display. - Select
Button Formatteras the formatter for the field. - Configure formatter options such as custom label, open in new tab, icon display, or external link behaviour.
- Save the display configuration.
- Observe invalid configuration schema warnings when the formatter configuration is saved, including the invalid
boolrantype, the missing schema foris_external, and the malformedradius::schema key. - Configure and save the module global settings.
- Observe additional schema warnings because the
button_formatter.settingsconfiguration 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_labelschema type fromboolrantoboolean. - Add the missing
is_externalformatter setting as aboolean. - Fix the malformed
radius::formatter schema key toradius. - Add a top-level
button_formatter.settingsschema definition usingconfig_object. - Define
styles,sizes, andradiusas sequences of strings, matching the install configuration and settings form behaviour. - Define
global_classandexternal_linkas 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.
Issue fork button_formatter-3602860
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
Comment #3
lolgm commentedMR !7 implements the proposed solution in this issue.
Comment #4
lolgm commentedComment #5
david.muffley commentedI 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.