Hi.
The validator "unique value on multiple fields" points empty values as non unique.
When this will happen? If you have two empty fields or two empty instances - delta 0 and 1 - of a multiple valued field the validator will trigger and will not allow you to continue.
I believe this is a bad behavior since drupal will always ignore empty values and will not save it to the database.
I also believe you might use mandatory fields if you need to avoid them to be empty.
The available patch changes this behavior and the validator "unique value on multiple fields" will ignore all empty values when checking the uniqueness.
A numeric with zero or a text with spaces are not empty!
Regards,
Gilsberty
Comment | File | Size | Author |
---|---|---|---|
#1 | field_validation-2241699-1.patch | 1.04 KB | gilsbert |
Comments
Comment #1
gilsbert CreditAttribution: gilsbert commentedPatch for the issue!
Comment #2
rakesh.nimje84@gmail.com CreditAttribution: rakesh.nimje84@gmail.com commentedOn which version I should apply this patch because there is difference in the file which you have mentioned.
Comment #3
gilsbert CreditAttribution: gilsbert commentedHi @rakesh.nimje84 .
For the version 7.x-2.4 of field_validation the issue is gone and my patch is not necessary anymore. After reading your message I did the test using a multivalued text field and a multivalued entity reference field with success.
In another words: the maintainer fixed the issue and the validator "unique value on multiple fields" no longer points empty values as non unique.
I recommend the version 7.x-2.4 and I'm marking this issue as closed (fixed).
I would like to thank the module's maintainer for the changes on the validator.
Regards,
Gilsberty
Comment #4
gilsbert CreditAttribution: gilsbert commentedComment #5
scotwith1tPerhaps this is fixed for the multiple values option, but it still fails validation if you use the Unique Values option (not multiple) and considers the empty field not unique. Perhaps there's a way to do this with conditional validation or some setting on the rule, but I can't figure a way to make it work...creating new issue since I can't reopen...