// Potentially the #value is set directly, so it contains the 'target_id'
// array structure instead of a string.
if ($input !== FALSE && is_array($input)) {
- $entity_ids = array_map(function(array $item) {
+ $entity_ids = array_map(function (array $item) {
return $item['target_id'];
}, $input);
$value = NULL;
if (!empty($element['#value'])) {
- $options = [
+ $options = $element['#selection_settings'] + [
'target_type' => $element['#target_type'],
'handler' => $element['#selection_handler'],
- 'handler_settings' => $element['#selection_settings'],
];
/** @var /Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
$handler = \Drupal::service('plugin.manager.entity_reference_selection')->getInstance($options);