Problem/Motivation
The default element_validate, validateEntityAutocomplete attempts to matchEntityByTitle if it does not find entity id in the expected format 'Title (id)'.
Steps to reproduce
Enter an entity id and submit the form before the autocomplete finishes.
Proposed resolution
Add a method to EntityIdAutocomplete to validate the element. Set the element validation in getInfo.
Remaining tasks
- create EntityIdAutocomplete ::validateEntityIdAutocomplete method
- Add EntityIdAutocomplete ::getInfo
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3303413-element-validate-2.patch | 7.71 KB | bluegeek9 |
Issue fork autocomplete_id-3303413
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bluegeek9 commentedComment #4
bluegeek9 commentedComment #6
bluegeek9 commentedLine 173 of src/Element/EntityIdAutocomplete.php needs to be changed. Not all entities use id as an id. Nodes use nid.
Comment #9
mostepaniukvmComment #11
mostepaniukvmMerged PR to fix bugs in dev version. Tagged new d10 compatible release. Feel free to review changes and reopen afterward if needed.
Set issue to fixed