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?
Comments
Comment #1
tz_ CreditAttribution: tz_ commentedComment #1.0
tz_ CreditAttribution: tz_ commentedRemoved images
Comment #2
gintass CreditAttribution: gintass commentedThis 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.
Comment #3
vostro CreditAttribution: vostro commentedin my case is a problem. in D6 work perfect multivalue field validate. when I migrate to D7, this validation should be present too.
Comment #4
gintass CreditAttribution: gintass commentedOkay, 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.
Comment #5
mooru CreditAttribution: mooru commentedI 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
Comment #6
Vacilando CreditAttribution: Vacilando as a volunteer commentedAnybody ever found a solution to this?
Comment #7
AstonVictor CreditAttribution: AstonVictor as a volunteer and at DevBranch commentedI'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