Fields in combination must be unique

Created on 21 June 2022, over 2 years ago
Updated 15 April 2024, 6 months ago

Currently the module seems to ensure uniqueness of a single field but it would be nice to check uniqueness of fields in combination. In my use case I have a taxonomy term reference called product. I want the node title to be unique for each product, so if I have a node referencing product "a" with title "foo" I want to make sure to not have another node of product "a" with the same title, but it is fine if a node with product "b" also has title "foo".

It is already possible using the hook_query_unique_field_ajax_alter() but it's somehow not transparent as on the field settings form I do not have an option like "unique in combination with field product".

Maybe in version 3 the check for uniqueness could be implemented as plugin that way there won't be any need to alter queries at all, just add a new plugin for a new use case, not already covered by the module.

Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

🇩🇪Germany osopolar 🇩🇪 GER 🌐

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.

  • 🇩🇪Germany osopolar 🇩🇪 GER 🌐

    Add patch for 2.x branch, as since 2.2.2 patch from #7 (3.x for 3.x and 2.x <= 2.1.1) does not work anymore for 2.x branch and development currently takes place in 2.x branch, but not 3.x, see 🌱 Roadmap for 3.x Active .

Production build 0.71.5 2024