I’ve looked all over, and for my level of understanding, I can’t figure out how to get the stored value of an entity autocomplete field targeting taxonomy term type. I thought I could do something similar to what I have for select field, but it breaks the page. This is for a custom field…
$element['description_term'] = array( '#type' => 'entity_autocomplete', '#target_type' => 'taxonomy_term', '#selection_settings' => [ 'target_bundles' => [ 'descriptors' ], ], '#title' => t('descriptor'), 'default_value' => previously-entered-value, // this didn't work... '#default_value' => isset($items[$delta]->descriptor) ? $items[$delta]->descriptor : NULL, '#required' => FALSE, );