Loading
fix: #2903340 Do not add the same term twice
Issue: https://www.drupal.org/project/autocomplete_deluxe/issues/2903340
The suggestion list already hides a term that is in the field. Typing that term again and pressing Enter still added a second tag, because the typed text carries no entity id while the item is stored under Label (7), so the two never matched.
The typed value is now compared against the labels that are in the field, with the trailing id taken off, so the same term is not added twice. A genuinely new term is unaffected.
Tested on Drupal 11.4: picking Drupal and then typing Drupal + Enter leaves one tag, while Quite New Topic + Enter is still added, and the node saves with both terms.
AI-Generated: Yes
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
-
Automated unit testing coverage - Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release
Edited by Rajab Natshah