Closed (fixed)
Project:
Views Autocomplete Filters
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2018 at 06:12 UTC
Updated:
13 Apr 2023 at 06:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
carlitus commentedComment #3
Anonymous (not verified) commentedI can confirm this.
This seems to be line 44 in the latest code.
Comment #4
Anonymous (not verified) commentedAttached now a simple patch that solves the issue (for me).
Comment #5
trevorbradley commentedI *just* hit this myself.
A few notes:
Patch #4 applies against dev, not 1.2. (Should have read the patch filename to notice this)
Also, I'm not sure quite what's going on, but if I apply this patch, I can't get the "Add some fields to view" to work at all.
If I reverse the patch, then "Add some fields to view" works in some, but not all, of my views.
Comment #6
Anonymous (not verified) commentedTrevor, I'm not sure I understand what you mean. Without the patch, I was not able to get views_autocomplete_filters to work, as it always just showed "Add some fields to view", even though the view had fields. As a result, autocomplete did not work (as it did not know from where to take the values for autocomplete). With the patch, I can select from the fields that have been added, and as default it shows the field used to filter (I haven't tried what happens if that field hasn't been added before). Autocomplete then works.
I don't know what you mean by 'I can't get the "Add some fields to view" to work at all.', because that is just a message that you should add fields to the view, and you do that in the usual place (so, if you don't have a field based view but display the entity in a display mode, you might need to force some fields, but I haven't tried that).
Comment #7
kallado commentedI still can't get it to work even with the patch. It still asks to "add some fields to view" does anyone have any update on this?
Thanks
Comment #8
kallado commentedComment #9
Anonymous (not verified) commentedIs your view display based on displaying the entities in a view mode or on fields? You add fields the usual way you add fields in views, and then better_exposed_filters can pick them up. But if no fields have been added to your view display because you display the entities, then that might be the problem.
The message "Add some fields to your view" suggests no fields have been added.
Comment #10
kallado commentedI have a lot of fields. Actually if comment the hole 'if' in the patch I can get them available on the select box the problem is that even image fields are available which is something we shouldn't want and the autocomplete only finds one element.
Comment #11
Anonymous (not verified) commentedAnd you can't select any of them?
I have not really debugged this, only turned the solution by the original poster (which worked for me and allowed me to select from the fields) into a patch.
It probably requires some more debugging of
if ($handler->realField . '_value' == $this->realField)I'm afraid, as 1) it works for me and 2) I don't have time right now, I can only suggest to debug what the $handler object looks like compared to $this->realField.
Comment #12
kallado commentedThanks anyway I was doing that already :). Unfortunately I don't have a lot of time to spare right now but as soon as I have any other info I'll post it
Comment #13
kallado commented@carlitus @andreas-speck @trevorbradley
the patch doesn't work for me because the first element of the 'if' is $handler->field and not $handler->realField. Here's a patch that works for me.
Comment #14
Anonymous (not verified) commentedIt seems what we need to compare against depends on the field type.
This patch now does replace the test with the following:
This should take care of all the cases people had issues with (I hope).
Comment #15
Anonymous (not verified) commentedComment #16
kallado commentedThanks. It works for me, seams like it takes care of all the cases now.
Comment #17
bisw commentedIt works for me too.
Comment #18
kallado commented@carlitus @andreas-speck maybe it's time for someone to mark this as fixed
Comment #19
Anonymous (not verified) commentedThat depends on @vasike, the module maintainer, committing the patch.
Comment #20
Anonymous (not verified) commentedComment #21
kris77 commentedIt works for me too.
Thanks @Andreas Speck
Comment #22
nasseralikarimi commented#4 applied but not listed any data!
Comment #23
kallado commented@na.karimi what patch have you aplied?
Comment #24
TonyMarc commentedI could not apply #14 to the current v1.2 because line 44 already contains
I adjusted the patch accordingly.
Comment #25
colanThere's far too much code duplication in the patch. Would be better to do something like:
Comment #26
colanI implemented that, moved the section to its own method (as
buildOptionsForm()is already too long), and removed some nesting.Comment #27
aleevasThanks for all who working on this patch.
I've stacked with this issue too.
The patch from #26 almost solved this issue.
But it didn't apply for latest version of module (8.1.2).
Moreover in patch from #26 was missed the "autocomplete_combine_results" option.
So I made own patch, and hope it solve this issue.
Comment #28
aleevasSorry, I was wrong in my previous comment.
We don't have "autocomplete_combine_results" option in current branch.
It comes from another issue #3100867
So I removed this option from patch for this issue
Comment #29
aleevasMy previous patch successfully applied on dev branch, but not for the current version 8.x-1.2
I added patch for this version (for the tag 8.x-1.2)
Comment #30
colanCutting through some of the comments above, here's a helpful interdiff. As there's not much value introduced in #28, and given that it introduces many whitespace errors, let's ignore it. The exception is the following code, which should be fixed. So #26 is NW until this gets done (the other patches can be ignored as we need to fix this in HEAD):
Should be
$this->t().@aleevas: That's for catching it.
Comment #31
colanComment #32
aleevas@colan thanks for your review.
I've uploaded a new one patch for HEAD .
I hope it will be usefull
Comment #33
aleevasComment #34
vasikeIt seems there could be a related issue and its patch ...
So added as related issue to be taken into account ...
put it back in "Needs work" to make sure about related issue
Comment #35
colanPlease don't create deadlock by setting a collection of independent issues to NW.
Comment #36
colanComment #38
colanThanks everyone! There was still extra whitespace in #32 so I made the change from #30 in another commit.
Comment #40
kallado commentedComment #41
carlitus commentedHi!, from my humble position, is it possible that since I have not uploaded a patch you have forgotten about me when awarding credits?
If it was a conscious thing then I accept it, it was just to make sure it wasn't an oversight.
Thank you!