Commit 032ad72b authored by alexpott's avatar alexpott

Issue #2879918 by _Archy_, amateescu, Sam152, grathbone: Send entity to...

Issue #2879918 by _Archy_, amateescu, Sam152, grathbone: Send entity to selection handler on validate
parent 1588e2b5
......@@ -91,8 +91,10 @@ public function validate($value, Constraint $constraint) {
return;
}
$entity = !empty($value->getParent()) ? $value->getEntity() : NULL;
/** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler * */
$handler = $this->selectionManager->getSelectionHandler($value->getFieldDefinition());
$handler = $this->selectionManager->getSelectionHandler($value->getFieldDefinition(), $entity);
$target_type_id = $value->getFieldDefinition()->getSetting('target_type');
// Add violations on deltas with a new entity that is not valid.
......
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