I have a node with a multi-value entity reference field. I have a view that displays a list of the entities that can be referenced from my node. I am passing the nid to the view as a contextual filter, which limits the results displayed by the view to those referenced by the node. This works.
I have an autocomplete filter on the view on the referenced entities' title. When I start typing, the autocomplete filter suggests referenced entities from other nodes.
It's a bit confusing to explain, so I will try to demonstrate.
Node 1 ( nid: 1 )
- field_entity_reference_field
- entity A
- entity B
Node 2 ( nid: 2 )
- field_entity_reference_field
- entity C
- entity D
"View of Entities" - Contextual Filter: nid
Filter: Entity Title
Pass the NID "1" to the view.
View Results:
- entity A
- entity B
Autocomplete filter suggestions:
- entity A
- entity B
- entity C
- entity D
So, the autocomplete filter fails to consider the contextual filter, displaying suggestions that aren't in the view display. Does that make sense?
Comments
Comment #2
scottsawyerFound this related issue for D7. In my case, the Contextual Filter is using "When the filter value is NOT available" -> Provide a default value -> Raw Value From URL. I have a view of Nodes referencing an Entity. I am embedding the view block in the Entity Display, and using the Entity's ID as the filter.
Comment #3
localnetwork commentedHaving this issue too.
Comment #4
vasikeThis looks like duplicate of
https://www.drupal.org/project/views_autocomplete_filters/issues/3259438
... cleanup the queue.