I'm experiencing an unexpected behaviour (bug?) using Unique Field. I have a content type where I've set it to be Unique. The module works as expected as long as you only use a single value, but the field for the content type can have multiple values ("Add another item"). As soon as I add another item, Unique Field stops checking that field and let's it through, even though it's not unique.

Step 1: Create new content with some text in the field that's supposed to be unique. Save.

Step 2: Create another node and use the same text for the field. Unique Field flags it as not unique.

Step 3: Just press "Add another item", type something unique in the second field. Unique Field now doesn't fire any warning and non-unique value is saved to database.

Am I doing something wrong or missing something?

CommentFileSizeAuthor
#1 uq1.jpg9.62 KBtz_
#1 uq3.jpg11.12 KBtz_
#1 uq4.jpg18.81 KBtz_
#1 uq2.jpg12.63 KBtz_
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tz_’s picture

FileSize
12.63 KB
18.81 KB
11.12 KB
9.62 KB
tz_’s picture

Issue summary: View changes

Removed images

gintass’s picture

Issue summary: View changes

This is probably not a bug since field with multiple values is being checked and rejected as not unique, if all values are the same in both nodes with multivalued fields. If at least one value is different, then these two nodes are considered unique and can be created. This might be fine in some cases, therefore you can't consider this as a bug.

In my case this is a problem since I have a requirement that every single value in each node should be unique. It would be ideal if there was a configuration option that allows you to decide what is considered unique in multivalued field:
a) each value has to be unique
b) combination of values have to be unique

Right now only option b is available.

vostro’s picture

in my case is a problem. in D6 work perfect multivalue field validate. when I migrate to D7, this validation should be present too.

gintass’s picture

Okay, so I guess this is a bug if the D6 version checks each value separately and D7 version doesn't. I tried to achieve the same result with Field Validation module and if I check only one field with multiple values, then it works well, but I need to check whether combination of fields is unique.

mooru’s picture

I have the same challenge with #4. Using field validation will be good if it can work as a combination but haven't found a way yet

Vacilando’s picture

Anybody ever found a solution to this?

AstonVictor’s picture

Status: Active » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks