Entity Name Uniqueness provides shared validation for Drupal configuration entities whose human-readable names must be unique. It prevents duplicate names that differ only by letter case or surrounding whitespace, ensuring a consistent administration experience.
Features
Entity Name Uniqueness provides reusable validation logic for configuration entities.
Features include:
- Prevents duplicate configuration entity names.
- Treats names as case-insensitive.
- Ignores leading and trailing whitespace when validating names.
- Provides validation at both form and entity save levels.
- Protects programmatic entity saves as well as UI-based edits.
- Reusable base classes for configuration entities and entity forms.
- Utility service for custom validation scenarios.
Typical use cases include:
- Connection and integration entities.
- External service configuration records.
- Mailbox, queue, or provider definitions.
- Any configuration entity where administrators select items by name.
- Custom modules that require human-readable names to remain unique.
Post-Installation
This module has no configuration page and requires no administrator setup.
Developers can begin using the functionality immediately by extending the provided base classes in their custom configuration entities and forms.
For most use cases:
- Install and enable the module.
- Extend
UniqueNameConfigEntityBasefor configuration entities. - Extend
UniqueNameEntityFormfor entity forms. - Entity names will automatically be validated for uniqueness.
The module can also be used through its helper service when custom validation logic is required.
Additional Requirements
- Drupal 11
No additional libraries, services, APIs, or contributed modules are required.
Recommended Modules/Libraries
This module is intended for developers building custom Drupal solutions that define configuration entities.
It is particularly useful for integration and configuration management modules where entities are frequently selected by their display names.
Similar Projects
Many Drupal projects implement their own custom validation to prevent duplicate configuration names.
Entity Name Uniqueness provides a reusable, centralized solution that can be shared across multiple modules, reducing duplicate code and ensuring consistent validation behaviour.
Supporting this Module
Issues, bug reports, feature requests, and community contributions are welcome through the Drupal.org issue queue.
Feedback from developers helps improve the module and identify additional validation use cases.
Community Documentation
Documentation is provided in the project README and includes examples showing:
- How to implement unique-name validation using the supplied base classes.
- How to validate names using the helper utility.
- How uniqueness checks behave when editing existing entities.
Developer Notes
The uniqueness check compares trimmed entity labels using a case-insensitive comparison. Validation is scoped to a specific entity type, allowing the same name to exist in different configuration entity types while preventing duplicates within the same type.
The entity save validation ensures protection even when entities are created or updated programmatically rather than through standard Drupal administration forms.
This one is actually much easier to get approved on Drupal.org because it's narrowly scoped, has a single clear responsibility, and has no external dependencies.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Entity ecosystem
Most installed first
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.x-dev | Dev | 11 | First release, for development only | Sep 18, 2026 |