Commit 0cfeca14 authored by alexpott's avatar alexpott
Browse files

Issue #2461523 by chx: UniqueFieldValueValidator condition is invalid EntityQuery

parent a68c0462
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment