Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Would it be possible to add an option to have the filter query automatically run after an autocomplete selection has been made? Ideally, the option could be toggled with a checkbox in the view settings after the filter has been added.
This is configurable with the Finder module http://drupal.org/project/finder and it would make Autocomplete Filters more convenient.
Comment | File | Size | Author |
---|---|---|---|
#12 | submit_query_on_selection-1724278-12.patch | 4.69 KB | alok.tiwari |
#11 | submit_query_on_selection-1724278-11.patch | 3.84 KB | sandzel |
#9 | submit_query_on_selection-1724278-9.patch | 3.83 KB | Ruichao |
#8 | interdiff_6-8.txt | 2.93 KB | holist |
#8 | views_autocomplete_filters-submit_query_on_selection-1724278-8.patch | 3.18 KB | holist |
Issue fork views_autocomplete_filters-1724278
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 #1
santiwww CreditAttribution: santiwww commentedI needed the same functionality so I created a patch to include it.
To use it there's a modification needed in autocomplete.js from core which already has a patch (#365241: Add select event to autocomplete feature)
I've tested it with drupal 7.34.
Comment #2
victoriachan CreditAttribution: victoriachan at Torchbox commentedTested. This works great for me. Thanks!
I've rerolled the patch as it somehow didn't apply for me.
Comment #3
vasikei couldn't make it work.
I'm not sure the autosubmit js works.
am i missing something?
thank you
Comment #4
ivoo56 CreditAttribution: ivoo56 commentedThanks santiwww !
Autocomplete patch worked for me, but only after I turned Use Ajax to Yes in view configuration tab. I did not need to apply the core patch because my D7 version already had it.
Comment #5
edurenye CreditAttribution: edurenye at ENDPHASYS Technologies commentedI think that option must default to TRUE.
This issue also happens in d8, so I fixed it there. When fixed we can backport it.
Comment #6
edurenye CreditAttribution: edurenye at ENDPHASYS Technologies commentedOps, I was not using the settings, sorry.
Comment #7
vasike2 things for the latest patch (#6)
- i wouldn't make this option default to TRUE - it affects the current implementation, and maybe it's not desired
- there is nothing to let us know the form will be/ it is submitted.
I think we need something there to tell us about what's happening.
I also could do a manual submit before the script does it job.
Comment #8
holist CreditAttribution: holist at Siili Solutions commentedRerolled #6.
Comment #9
Ruichao CreditAttribution: Ruichao as a volunteer commentedThis patch is based on #6.
It includes below changes:
1. auto filter option default to false.
2. changed the js handler to use jquery ui select handler to submit. It works with both AJAX and non-AJAX and thus works in views preview.
Comment #10
webdrips CreditAttribution: webdrips commented#9 broke all views filters for me...seems to have removed "Remember the last selection
Enable to remember the last selection made by the user.", along with the checkboxes for the user roles. I had this set for some views.
#8 seems to be a safer bet so far.
Edit: #8 isn't working either, and I believe it can't be used with ajax.
Comment #11
sandzel CreditAttribution: sandzel at FFW commentedI adjusted patch from #9 to work with a views that has many submit buttons.
Comment #12
alok.tiwari CreditAttribution: alok.tiwari as a volunteer and at Srijan | A Material+ Company commentedModified #11 to align with V. 8.x-1.7,
also defined autosubmit field to file :
views_autocomplete_filters.module
as the field's data wasn't getting stored while saving views.Fixed Minor PHPCS issues.
Comment #13
alok.tiwari CreditAttribution: alok.tiwari as a volunteer and at Srijan | A Material+ Company commentedComment #14
vasikeThere will be no features for 8.x ... so 2.x should be considered
And unfortunately the latest one fails to apply.
Comment #16
vasikeMR available - created from previous patches ... thanks to all
+ some small updates and made it green.
Comment #18
vasikeand MR merged ... now the autosubmit should be available in the latest dev version
composer require 'drupal/views_autocomplete_filters:2.0.x-dev@dev'
Leave the issue in
Needs review
- for now - to get some feedback for the "results".thanks to all for the efforts on this.
Comment #19
vasikeTests added that covers this ... so we should be covered.
+ New release which includes this ... so Fixed.