Skip to content
Snippets Groups Projects
Commit 0cfeca14 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2461523 by chx: UniqueFieldValueValidator condition is invalid EntityQuery

parent a68c0462
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ public function validate($items, Constraint $constraint) {
$value_taken = (bool) \Drupal::entityQuery($entity_type_id)
// The id could be NULL, so we cast it to 0 in that case.
->condition($id_key, (int) $items->getEntity()->id(), '<>')
->condition($field_name, db_like($items->first()->value), 'LIKE')
->condition($field_name, $items->first()->value)
->range(0, 1)
->count()
->execute();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment