Problem/Motivation
Seems not to be working with entity reference/relationship on title field. Fields have same machine name. Tried different things.
First try was shown in this video for Drupal 7: Drupal 7 Views Autocomplete Filter Tutorial
Second attempt was to try both, title field and title filter give reference/relationship.
Unfortunately, nothing seems to work correct. The output of autocomplete isn't shown expected results, but when i type the title in hit enter, the output of the search result is right.
BTW: In that related issue, the author says, there's no "contains" option. This isn't my problem!
Comments
Comment #2
awolfey commentedI'm having this issue also. I'm referencing a node from a group, and using an entity reference field.
Comment #3
ccloyd commentedI had this issue with the 1.4 version. Reverted back to 1.3 and entity references work again. In the 1.4 version it appears to be an issue with the ViewsAutocompleteFiltersController.php file, specifically around line 220 in the autocomplete function.
Comment #4
deranga commentedAlso ran into this issue whereby the update to 1.4 prevents the autocomplete from returning results.
1.3, previously used the style plugin to render the result fields of the executed view, however the new method attempts to load the 'views machine named' field direct from the loaded result entity.
Depending upon your use case, its possible as a workaround to reconfigure the exposed filter to behave in a similar fashion to 1.3, by unchecking either or both the "Unformatted dropdown" or "Unformatted suggestion" options to off. This then triggers the autocomplete to make use of the style plugin to render output as before.
Comment #5
ericdsd commentedThanks @deranga, for the workarround !
Comment #7
vasikeIndeed this "capability" was lost.
There is a new commit that should fix this.
Could we have the confirmation, so we can close this?
Thank you
Comment #8
mvogel commented@vasike, great work that you found a way to distinguish between the entity and possible entity relationship. I tested it and it works almost 100%
I have found a bug but I think it is a combination of this issue and https://www.drupal.org/project/views_autocomplete_filters/issues/3345680
Steps to reproduce:
1. add a plain text field to node article (field_plain_text)
2. add entity reference field to user pointing on node article (field_reference_field)
3. create a node article with a filled field from (1) and update a user field_reference_field to this node
4. create a user entity view with a page
5. add "Relationships" to content from field_reference_field
6. add a field from (1) to "Fields" and add "Filter criteria" with the exposed form and "Use autocomplete"
7. visit the page from (4) and search for the value you created in (3)
$real_field_name = 'field_plain_text_value'for some reason see screenshotI hope you can reproduce it, it is kinda hard to explain, if you need a video or want a call you can write me
Comment #9
vasike@mvogel thanks ... this is not about relationship ... it's about views data ... so good catch ... please check the latest code and the other issue ... where i pushed the commit.
Comment #10
vasikei think we can close this.
please, feel free to re-open, if not done.
Comment #12
mistergroove commentedHaving the same issue with relationship - no values are returned from the callback:
http://myserver/views-autocomplete-filters/protocols/block_method/title/0?q=johnAlso I noticed I changed the filter identifier from 'title' to 'author'. Should this also be reflected in the url?
Anyone else still having this issue?