"The combination of values from the specified fields must be unique" option doesn't work

Created on 6 October 2017, over 7 years ago
Updated 13 March 2025, 21 days ago

This option doesn't work. In the code it's checked separately each field

It should fail only if both of the fields fails.

Steps to reproduce:

Checkmark two fields under a content type's "Unique Field restrictions" in the "Choose the fields that should be unique" listing, for example "Given name" and "Family name"

For "Choose the scope for the unique values" select "Content type".

Under "Choose whether values must be unique individually or in combination" select "The combination of values from the specified fields must be unique"

Create a piece of content, "John" and "Smith" in Given and Family names.

Try to create another piece of content, "John" and "Jacob Jinglehymer"

You will get an error, "The field Given name has to be unique."

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡·πŸ‡΄Romania cslevy

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Still not working and this is arguably half of the documented functionality, not working, so i would call this major at least until the module page and internal documentation is updated to note this functionality is aspirational and not in fact implemented in current versions.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    The code to make it work was partially there. The merge request finishes and fixes that work.

    Also wanted to note that ECA module β†’ could be configured to do this and it has true entity validation now ✨ eca_content: Provide plugins for entity validation Fixed

    … and true entity validation, not form-level validation, is what i wanted and expected from Unique Field but that is not what Unique Field does. That should also be documented clearly or fixed, but i hope my contribution here is useful but i'm going to switch to ECA.

  • Pipeline finished with Success
    21 days ago
    Total: 182s
    #447449
Production build 0.71.5 2024