Hi,
I've created a "Unique values" rule over a text field, with number of values Unlimited.
When I write the same value in 2 rows of this field, the Drupal break to white page with the error:
Notice: Undefined variable: matched_entities in field_validation_unique_validator->validate() (line 100 of /sites/all/modules/contrib/field_validation/plugins/validator/field_validation_unique_validator.inc).
Warning: array_keys() expects parameter 1 to be array, null given in field_validation_unique_validator->validate() (line 100 of /sites/all/modules/contrib/field_validation/plugins/validator/field_validation_unique_validator.inc).
Warning: reset() expects parameter 1 to be array, null given in field_validation_unique_validator->validate() (line 101 of /sites/all/modules/contrib/field_validation/plugins/validator/field_validation_unique_validator.inc).
Warning: reset() expects parameter 1 to be array, null given in field_validation_unique_validator->validate() (line 102 of /sites/all/modules/contrib/field_validation/plugins/validator/field_validation_unique_validator.inc).
Warning: reset() expects parameter 1 to be array, null given in field_validation_unique_validator->validate() (line 103 of /sites/all/modules/contrib/field_validation/plugins/validator/field_validation_unique_validator.inc).
Notice: Undefined index: entity keys in field_validation_unique_validator->validate() (line 105 of /sites/all/modules/contrib/field_validation/plugins/validator/field_validation_unique_validator.inc).
Notice: Trying to get property of non-object in field_validation_unique_validator->validate() (line 106 of /sites/all/modules/contrib/field_validation/plugins/validator/field_validation_unique_validator.inc).
Notice: Undefined index: controller class in entity_get_controller() (line 7812 of /includes/common.inc).
Comments
Comment #1
g089h515r806 commentedhave you solve it?
you use unique validator.
A lot people use it, it seems that no other people report the same issue.
Comment #2
alisamar commentedI'm having a similar problem.
Comment #3
micromegas commentedI've run into the same issue. the problem is in field_validation_unique_validator; in the case of duplicate items entered on the same entity, it sets $FLAG to false and skips the queries, as it should, but afterwards it still tries to set up the rest of the variables as if the query had taken place.
What is the state of the dev code from git? When I pull it, it is missing all of the validation rules except for regex and has the test text '123456' on the validation settings pages.
Comment #4
gooddesignusa commentedI'm also having the same issue with unique validation for node references.