Why aren't we sending the entity to the selection handler when validating? Couldn't we just get the entity from the item and add it to the plugin?

See Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator line 95.

$handler = $this->selectionManager->getSelectionHandler($value->getFieldDefinition(), $item->getEntity());

Comments

_Archy_ created an issue. See original summary.

_Archy_’s picture

_Archy_’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: entity_reference-send_entity_to_selection-2879918-2.patch, failed testing.