Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | autocomplete_deluxe-entity_id_in_entity_label-2903342-3.patch | 751 bytes | adinac |
#2 | autocomplete_deluxe-term_id_in_result-2903342-2.patch | 579 bytes | bgilhome |
Screen Shot 2017-08-19 at 10.45.17.png | 22.19 KB | fotidim | |
Screen Shot 2017-08-19 at 10.44.18.png | 11.83 KB | fotidim |
Comments
Comment #2
bgilhome CreditAttribution: bgilhome commentedThis 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.
Comment #3
adinac CreditAttribution: adinac as a volunteer commentedI 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.
Comment #4
adinac CreditAttribution: adinac as a volunteer commentedComment #5
adinac CreditAttribution: adinac as a volunteer commentedComment #6
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #7
sickness29 CreditAttribution: sickness29 at DevBranch commentedThe 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