Missing Schema for Taxonomy

Created on 3 October 2025, 9 days ago

Problem/Motivation

Configuration specifying whether the title must be unique for a taxonomy get written to unique_entity_title.settings, in a format like:

[taxonomy_name]_taxonomy_unique: 0

There is no schema definition to match this format. Tools such as config_inspector will report that it is invalid.

Steps to reproduce

1. Install config_inspector for help testing.
2. Add a taxonomy term, or edit an existing one.
3. Check the config_inspector report.

Proposed resolution

The ideal, if I understand Drupal best practices correctly, would be to treat taxonomies the same way you are already treating nodes, putting the value in the third_party settings for each type. The addition to schema I believe would look like:

taxonomy.type.*.third_party.unique_entity_title:
  type: mapping
  label: "Per-taxonomy unique entity title settings"
  mapping:
    enabled:
      type: boolean
      label: "Unique entity title"

For that to work, you'd have to change where the config gets saved. The current version seems to be in unique_entity_title.module, in unique_entity_title_form_taxonomy_vocabulary_form_alter and unique_entity_title_taxonomy_form_vocabulary_submit. I believe you could essentially mirror what you're doing for nodes in unique_entity_title_form_node_type_form_alter and unique_entity_title_form_node_type_form_builder to change that to use third-party settings instead.

Finally, you would likely need to include a hook_update() implementation so that anybody who already had it set up with the old configuration could get programmatically migrated to the new configuration structure, not needing to set it again manually (in my case that wouldn't be a problem, but it would be for those who are actively enforcing unique titles on taxonomies).

🐛 Bug report
Status

Active

Version

1.6

Component

Code

Created by

🇨🇦Canada ryanrobinson_wlu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024