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