When adding terms the Term ID shows up in the field. This can also confuse the module thinking that this is a new term to be added in the taxonomy terms.
alt
alt

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

axaios created an issue. See original summary.

bgilhome’s picture

This is the default format returned by Drupal\Core\Entity\EntityAutocompleteMatcher.

Attached is a patch to set the results key to be the same as the term label.

adinac’s picture

I don't think that removing the entity id from the item value is the way to go. As someone mentioned here https://www.drupal.org/project/drupal/issues/2881892, it could have some unforeseen implications. I think it would be best to just remove it from javascript. This is an attempt at fixing the issue.

adinac’s picture

adinac’s picture

Title: Term ID shows up » The entity label displayed to users contains the entity ID
Rajab Natshah’s picture

Version: 8.x-1.0-beta1 » 2.0.x-dev
sickness29’s picture

Status: Active » Reviewed & tested by the community

The issue here is the way deluxe autocomplete works with single-value field, where there is only one textfield with value and this id in brackets is a way for entity reference field to find existing entity.
For multi-value fields there are hidden inputs which carry this id in brackets and visible textfield shows only labels to user.
Here are the issue to make single-value field operate and look the same as multi-value fields and I posted patch there - https://www.drupal.org/project/autocomplete_deluxe/issues/3273248#commen....
This way id is not shown and value is enclosed in bubble like for multi-value fields