I'm using Drupal 9.2. I have created entity reference views and use them as filter for entity reference fields (autocomplete widget). When I'm using only "Content: Title" field everything works as expected. When using more fields either hidden (rewriting Title) or visible, I get "There are no entities matching [my selection]" error on save.
*** Edit n.1 for more details:
I have a content type that has an entity reference field (autocomplete widget). When the user selects the referenced node I want the options to display something different than the node's title.
So I use "Views: Filter by an entity reference view" as Reference method of the field and I have created a view with an "Entity Reference Display" to use with the field.
If the only Field used in view is "Content: title" everything works as expected and the entity reference field is saved. If I use let's say "Content: Short name" then autocomplete field is indeed searching and showing Short name, but when I save the form I get "There are no entities matching [Short name]".
I have tried using only "Content: Title" and rewriting output and I still get the same problem.
The same happens if I use a view with users and I show firstname and lastname instead of username. Autocomplete widget searches and shows options with the selected fields correctly but saving the form result in error with no entities matching.
I really don't know how this feature works to start debugging. Is the actual referenced node id saved in a hidden field or element data attributes?
Does anybody have any idea why this is happening or how to debug? Thanks
*** Edit n.2
After some debugging I can see that method matchEntityByTitle of EntityAutocomplete is called which in turn calls getReferenceableEntities of ViewsSelection. To validate selechion this plugin searched for a match of the "value" (fields combination) in any of the fields marked for search. This normally returns no results and the field is not validated. So is this normal behaviour and this feature can only work with title (or single field) values or do I miss something else?