Alter-Entity-Autocomplete icon indicating copy to clipboard operation
Alter-Entity-Autocomplete copied to clipboard

Breaks entity_autocomplete configs in Drupal 9

Open ainsofs opened this issue 3 years ago • 0 comments

When I use below code. All bundles are displayed regardless of the values specified in 'target_bundles'. Uninstalling the module fixes it.

core: Drupal 9.2.2

$form['participant'] = [
  '#type' => 'entity_autocomplete',
  '#title' => $this->t('Participant'),
  '#weight' => '0',
  '#target_type' => 'node',
  '#selection_handler' => 'default',
  '#selection_settings' => [
    'target_bundles' => ['person'],
  ],
  '#tags' => TRUE,
];

ainsofs avatar Jul 26 '21 20:07 ainsofs