UX: Hide entity ID in autocomplete (add new with Modal) widget

Created on 12 June 2024, 6 months ago
Updated 20 June 2024, 6 months ago

Problem/Motivation

When using an autocomplete (add new with modal) with 'search button' or without button, widget adds the entityID in brackets after the entity name.
Sometimes it needs to be hidden.

Steps to reproduce

When using autocomplete (add new with modal), whether with a 'search button' or without, the widget appends the entityID in brackets after the entity name.
1. Create an entity reference field
(Reference type: Content).
2. In Manage Form View select 'Autocomplete (add new with modal)' .
3. The feature functions with the search button both enabled and disabled:

- When the search button is disabled, creating a new entity is possible:
3.1. A modal appears where you can create a new entity. After saving, the field will display the name of the new entity with its ID in brackets.
- If the search button is enabled, only searching for existing entities is enabled:
3.2. A modal appears where you select an existing entity. After selection, the field shows the name of the selected entity with its ID in brackets.

Proposed resolution

3.1 point.Hide it with PHP
3.2 point.Hide it with JavaScript

Remaining tasks

- Functionality Testing: After the proposed solution has been implemented, thorough testing of the EntityID hiding functionality, as well as the overall widget, is necessary to ensure everything operates correctly without impacting existing functionalities.
- Documentation: Prepare and update the module's documentation to describe the new functionality for both users and developers.

User interface changes

In the widget settings, a checkbox appears that is related to hiding the entity ID text.

API changes

No significant changes to the module's API are expected.

Data model changes

Changes to the data model are not anticipated

Feature request
Status

Active

Version

1.0

Component

User interface

Created by

🇧🇾Belarus rahunak

Live updates comments and jobs are added and updated live.
  • Needs usability review

    Used to alert the usability topic maintainer(s) that an issue significantly affects (or has the potential to affect) the usability of Drupal, and their signoff is needed. When adding this tag, make it easy to review the issue. Make sure the issue summary describes the problem and the proposed solution. Screenshots usually help a lot! To get sign-off on issues with the "Needs usability review" tag, post about them in the #ux channel on Drupal Slack, and/or attend a UX meeting to demo the patch and get direct feedback from designers/UX folks/product management on next steps. If an issue represents a significant new feature, UI change, or change to the general "user experience" of Drupal, use Needs product manager review instead. See the scope of responsibilities for product managers.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024