I've enabled "Unique values" validator and got the error after submitting a form.
Fatal error: Class name must be a valid object or a string in /home/www/includes/common.inc on line 7749
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | field_validation-1897664-1.patch | 516 bytes | chi |
Comments
Comment #1
chi commentedIt's seems to be easy fixed.
Comment #2
chi commentedComment #3
g089h515r806 commentedIf $matched_entities is not set, and $flag == FALSE, We still need to set_error().
Maybe we could fix it in this way:
Comment #4
jay.lee.bio commented@Chi, #1 didn't work for me. It did get rid of the error message, but then the validation itself no longer works (although I was never able to check if this specific validation even works in the first place due to the initial error message).
@g089h515r806, where do I apply #3?
P.S. Here's how I was able to reproduce this error message (TL;DR):
1) Use this module with Entity Reference.
2) Create an entity reference field and set a "Unique values" validation at /admin/structure/types/manage/CONTENT_TYPE/fields/ENTITY_REFERENCE_FIELD/validation.
3) Try creating a duplicate entity reference.