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.
In Views 7.x-3.x there's an option on the exposed filters settings to auto-submit the fields. This option no longer exists.
Comment | File | Size | Author |
---|---|---|---|
#86 | 2475595-ctools-autocomplete-fix-86.patch | 6.34 KB | DimaS11 |
#84 | 2475595-ctools-autocomplete-fix-84.patch | 6.34 KB | Vanguardian |
#81 | diff.txt | 428 bytes | sorlov |
#81 | 2475595-ctools-autocomplete-fix-81.patch | 6.22 KB | sorlov |
#74 | views-block.png | 346.02 KB | C13L0 |
Comments
Comment #1
DamienMcKennaThe option was removed from VDC in #1789270: Figure out what to do with ctools autosubmit in exposed form.
Comment #2
DamienMcKennaIt seems like the goal was to move this functionality into CTools, instead of core: #1790006: Add a autosubmit exposed form plugin
Comment #3
DamienMcKennaFYI the problem with the plan of "move it into CTools" is that CTools has been scrapped and needs to be rewritten.
We could see about rerolling the patch from #1790006 and turning it into a tiny module.
Comment #4
larowlanComment #5
DamienMcKennaHere's a small module I put together based on the patch. I'm happy to spin it off as a tiny submodule, but I think it'd be better being included in either core or CTools.
Comment #6
forestmars CreditAttribution: forestmars commented+1 for including views_filter_autosubmit in CTools.
Comment #7
lauriiiComment #8
glynster CreditAttribution: glynster commented++++++++++++++++++1 as a tiny sub module, better still add to views, does not matter, this is such a small and very valuable feature on many of our projects. @DamienMcKenna Thanks for the module works a treat!
Comment #9
AswathyAjish CreditAttribution: AswathyAjish commentedThis module worked for me. Thanks a lot.
Comment #11
dawehnerLet's move it to ctools, as there is nothing in core we could do about it.
Comment #12
DamienMcKennaMoving it to the correct project ;-)
I still don't see why this wouldn't fit in core?
Comment #13
dom18fr CreditAttribution: dom18fr commentedThanks DamienMacKenna for your module, it did the job for me.
However it seems that a call to
parent::exposedFormAlter($form, $form_state);
is missing, and it cause sort input render fail.
I just added this line in the attached zip.
Comment #14
sonfdAwesome! I was wondering what happened to this option.
It's a little awkward with autocomplete filters and especially awkward if you select an item with Tab. Not really sure of the best way to fix this issue (nor do I remember what happens in d7), just wanted to put it on radar.
Comment #15
sonfdJust uninstalled (
drush pmu views_filter_autosubmit
) this and the view that I had enabled auto-submission on was deleted. I noticed no uninstall hook here so it must be something in core?Comment #18
Arvey CreditAttribution: Arvey commentedThe custom module created. Is it still working? It is not working on my views preview. I'm using Drupal 8.1.0.
Comment #19
pheraph CreditAttribution: pheraph commented@Arvey: I see the Autosubmit as a filter option, but it doesn't work for me, too (Filters are placed in a block).
Comment #20
DamienMcKennaSeems like it needs work, then.
Comment #21
mark.labrecqueThanks Damien! This worked great for me on core v8.1.7 and solved an immediate need for me. If I find any issues with it, I will try to contribute back any fixes I come up with. Until the Ctools debate gets solved, maybe we could get this up as a sandbox project, so others can find it?
Thanks again!
Comment #22
ilya.no CreditAttribution: ilya.no as a volunteer and at Skilld commentedDamienMacKenna, thanks for the module! Works for me too. I've created patch from it, to be used also.
Comment #23
andypostThere's some issues with JS (needs work a bit for previews and keybindings)
do that needs schema updates?
minor, trailing whitespace
Comment #24
id.tarzanych CreditAttribution: id.tarzanych at Internetdevels commentedFixed JavaScript code for input fields.
Please review my patch.
Comment #25
andypostI still find this indent is wrong
Comment #26
NetNerdy CreditAttribution: NetNerdy commentedpatch #24 without results => test failed
localhost Drupal 8.1.8, php 7
Comment #27
DuneBLI have patched ctools with #24 then refresh the cache... those are the only things I have done
But I couldn't see the "hide submit button" under "Exposed form style" of an old view that I plan to convert into an autosubmit view...
Maybe I missed something?
I use Drupal 8.2
Comment #28
ilya.no CreditAttribution: ilya.no as a volunteer and at Skilld commented@NerdyCrowd, could you, please, describe your problem more precisely? Like did you use clean install or some additional modules? And what does "patch #24 without results => test failed"? It fails for views without results? Or it means your own test is failed? If so, please, describe your case.
@DuneBL, do you have ctools_views module enabled? If so, maybe you can try reinstalling it after patching?
Comment #29
DuneBL@ilya.no many thanks for your answer: you was right, ctools_views was not installed. Thus I install it and I could choose "Autosubmit" for ""Exposed form style".
Unfortunately, my submit button is still there (even after clearing caches)
I have 3 select and 1 autocomplete texte field (from the "Views Autocomplete Filters" module)
I don't know if this is important, bu I have also tried to change the "Apply" text of the submit button, but nothing changed.
Comment #30
DuneBL@ilya.no: This is working... I have made a wrong manipulation, the patch is doing the job!!!
Sorry for loosing your time
Comment #31
andypost@DuneBL which patch are you using? #22 or #24
Comment #32
andypost#24 looks ready to go
Comment #33
DuneBL@andypost: #24
Comment #34
tandroid CreditAttribution: tandroid at Elevated Third commentedFor anyone following this thread, if you apply #24 before installing "ctools_views" it will not work. You will need to uninstall and reinstall the module as @ilya.no mentioned in #28, but doing this will delete the entire view if you changed any settings that are provided by "ctools_views" so BE CAREFUL! Luckily, I had already exported my view to config.
Comment #35
tandroid CreditAttribution: tandroid at Elevated Third commented#24 is not working for me when the filters are exposed as a block. Just looking into it briefly, it seems like it's not getting the
views-auto-submit-full-form
html class.Comment #36
DamienMcKennaI suspect this needs a reroll and some tests to confirm it still works as intended.
Comment #37
flyke CreditAttribution: flyke commentedConfirming that enabling ctools_views and applying patch #24 works very well like it should here.
Comment #38
zincdesign CreditAttribution: zincdesign commented- I installed ctools_views
- applied the patch 24
- uninstalled ctools_views and reinstalled ctools_views
Cleared cache
I checked my view and the autosubmit option is still not available to me. What am I doing wrong?
Drupal 8.2.2
Views 8.2.2
ctools_views 8.x-3.0-alpha27
Comment #39
heshanlkThe patch appeared to be working fine, @zincdesign you need to change the Exposed form style to Autosubmit to make it work.
Comment #40
pebosi CreditAttribution: pebosi commentedPatch works for me too.
Comment #41
ahmadhalah CreditAttribution: ahmadhalah as a volunteer and commentedAwesome ... Its working fine
Comment #42
c_c CreditAttribution: c_c as a volunteer and commentedThanks for the work on this patch. I applied patch #24 to ctools 8.x-3.0-alpha27, but I am seeing that autosubmit only works with dropdown menus and does not provide you with an option to configure it to use other types of exposed filters. All of the exposed filters on the site i'm working on are checkboxes and im trying to get the checkboxes to autosubmit using patch #24. Ive tried this creating a new view page with an autosubmit exposed filter, and also editing an existing view that currently uses checkboxes and the Apply button to filter. How do you get the autosubmit functionality to work with checkboxes? Is there something i need to specify on the backend in custom code to do this?
Comment #43
Ralf Eisler CreditAttribution: Ralf Eisler commentedThanks for the patch. It works on ctools_views 8.x-3.0-alpha27 and 8.x-3.0-beta1.
Comment #44
Arlina CreditAttribution: Arlina at Chapter Three commentedConfirming this works for ctools_views 8.x-3.0-alpha27.
Thanks!
Comment #45
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedDrive by nitpick:
Can we switch to short array syntax?
Comment #46
kala4ekComment #47
kala4ekSwitched to short array syntax.
Comment #48
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedThanks @kala4ek, setting this to needs work for the tests =)
Comment #49
anruetherThanks for your work!
#47 doesn't work if the exposed filter is in a block. Using ctools 8.x-3.0 and drupal 8.3.2.
Comment #50
acbramley CreditAttribution: acbramley at PreviousNext for Transport for NSW commentedCan confirm #49, in fact enabling ctools_views makes my exposed sorts disappear completely even using the Basic type.
Comment #51
acbramley CreditAttribution: acbramley at PreviousNext for Transport for NSW commented#49/#50 is an unrelated bug, opened #2878418: Ctools views Block display plugin hides exposed sorts if views block has no exposed filters to track that.
EDIT: Can confirm with the above patch, #47 works well.
Comment #52
mikeker CreditAttribution: mikeker as a volunteer commentedFYI: CTools (7.x) autosubmit was added to Better Exposed Filters in #2764981: Add 'auto-submit' functionality to the exposed form about nine months ago.
Hope that helps folks still looking for this functionality, though I agree that this should be part of core.
Comment #53
Anybodyhttps://www.drupal.org/project/better_exposed_filters also offers the functionality for Drupal 8!
Comment #54
jbitdrop CreditAttribution: jbitdrop commentedBased on the last comments I wonder: can we set this issue Status to "fixed" then?
Comment #55
C13L0 CreditAttribution: C13L0 as a volunteer commentedPatch #47 works perfect, so changing status to Reviewed & tested by the community.
I don't think it has anything to do with this patch but I want to mention that ajax needs to be off when using the reset button or it will return you to the management view
Comment #56
jbitdrop CreditAttribution: jbitdrop as a volunteer and at MAROQQO studios commenteddeleted(dunno why double post happend here. Maybe my browser.)Comment #57
jbitdrop CreditAttribution: jbitdrop as a volunteer and at MAROQQO studios commented@C13LO: I was referring to
mistakenly (wrong issue) but you are right, for Ctools it's RTBC.
Comment #58
oriol_e9gI can confirm that #47 works and apllies cleanly
Comment #59
mpotter CreditAttribution: mpotter at Phase2 commentedNot sure why this is marked as RTBC. As mentioned several times above, this does not work when using a Block for the exposed form. Not related to sort order. When I select "Expose Form in Block" and then select the "AutoSubmit" exposed form style, then ensure the "Hide Submit button" setting is enabled, then when I go to my page that has a Views Block and the Exposed Filter block, selecting a value from the filter dropdown (Content Type) doesn't auto-submit the Ajax form.
So either this needs more work to determine why this fails when using a Block, or this plugin needs to give a warning or error when it tries to be used when Expose in Block is enabled.
Will look at better_exposed_filters as an alternative, but don't think this issue is ready for committing.
Comment #60
Oksana Skotar CreditAttribution: Oksana Skotar commentedI've installed and activated the module from #13.
Could not find where is the option to activate the Autosubmit. Finally found.
See Your view > Advanced > Exposed form style > click on Basic > change to Autosubmit > check "Hide submit button" in settings of Exposed form style.
Works perfectly!
Comment #61
GrienauerUsed module from #13.
Worked but the Settings menu is not working.
The Settings menu won't open if I click it…
Comment #62
Dimiter CreditAttribution: Dimiter at iO commentedUsing #47 works, but to improve UX and accessibility I'd propose to move the focus back to the input element after the Ajax submit is done.
Comment #63
Paulset CreditAttribution: Paulset commentedAny news ?
it is recommended to use the mode from # 13 or patch from # 47 ?
(I need an autosubmit for a filter exposed to my users (of type autocomplete))
Comment #64
bartmcphersonPatch in #47 seems to still be good after 8.x-3.1.
Comment #65
Mr_DeLeTeD CreditAttribution: Mr_DeLeTeD commentedI have try the #47 but i found this error while trying to updb
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "autosubmit" plugin does not exist.
Comment #66
C13L0 CreditAttribution: C13L0 as a volunteer commentedIf you updated Updated Chaos tools (ctools) from 8.x-3.0 to 8.x-3.2 you will need to re-apply patch #42 to 8.x-3.2.
The patch still works flawlessly with 8.x-3.2
Updating status to reviewed and tested by the community.
Comment #67
Chi CreditAttribution: Chi for DXPR commentedThat's not clear. What is wrong with having this in core? Seems like a pretty basic Views functionality.
Comment #68
joegl CreditAttribution: joegl commentedConfirmed patch in #47 resolved our issue #3034834: Exception : "The autosubmit plugin does not exist."
Comment #69
init90Also encountered with such problem after update module from
Chaos Tool Suite (ctools) 8.x-3.0+1-dev (2017-May-19)
toChaos Tool Suite (ctools) 8.x-3.2
. The patch from #47 fixed problem for me.Comment #70
C13L0 CreditAttribution: C13L0 commentedPlease add this to the next commit. I have to re-apply this patch every time there is an update. Reviewed and tested for 8.x-3.4 and patch works great.
Comment #71
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedSee #59.
Comment #72
C13L0 CreditAttribution: C13L0 commentedThe patch works perfectly fine with view blocks and ajax enabled. Message me and I will give you website to review.
Comment #73
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedAre you using a block for the exposed form @C13L0 ¿?
Comment #74
C13L0 CreditAttribution: C13L0 commented@Manuel Garcia,
This patch is being used for auto submit on a traditional Views block. The exposed filter is not in a separate block. I hope this clarifies. =)
Comment #75
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation commentedThanks @C13L0 - I marked this this issue as needs work because on #59 it's noted that
Comment #76
jbitdrop CreditAttribution: jbitdrop as a volunteer and at MAROQQO studios commented"Needs work" should be set by a user really testing and failing, not from a comment of another user ...
Comment #77
eworwa CreditAttribution: eworwa at Cyber-Duck commentedHi, I can confirm that patch on #47 applies and works just fine, my setup:
- Drupal 8.8.4
- CTOOLS 8.x-3.2
Also worth mentioning that the block it's been implemented through Layout Builder. I understand #59 might be an issue but it's 2 years old so maybe is no longer valid.
Comment #78
C13L0 CreditAttribution: C13L0 commented8 months later and we are still using patch #47. I would love to see it committed. =)
Comment #79
rcodina CreditAttribution: rcodina commentedThe patch doesn't work for me on a view using block display. I'm using Drupal 9.2.4 and Chaos Tool Suite 8.x-3.7. To get the autosubmit feature I have had to install Views Autosubmit module.
Comment #80
sorlov CreditAttribution: sorlov at Skilld commentedPatch from #47 is missing config schema for new autosubmit exposed form plugin
Comment #81
sorlov CreditAttribution: sorlov at Skilld commentedAdd config schema for autosubmit exposed form plugin from patch #47
Comment #82
hunchang CreditAttribution: hunchang commentedconfirm patch #81 work on Drupal 9.2.16 & cTools 3.7 with contextual filter & exposed filter setup.
Comment #83
DuneBLconfirm also the #81 apply on ctools 4.0
Comment #84
Vanguardian CreditAttribution: Vanguardian commentedWhen upgrading to Drupal 10 the patch in #81 runs into problems with the deprecation of the jQuery once() method. Modified the patch to work with D10. Please feel free to make changes as needed but this worked for my instance. Currently using the 4.x branch and this applied well.
Comment #85
Rob230 CreditAttribution: Rob230 at CTI Digital commentedI've seen this break on a number of D10 sites. Path in #84 fixes it.
Comment #86
DimaS11 CreditAttribution: DimaS11 commentedI have already old 81 patch installed, so to use updated 84 needs to bump up the library version. I added an updated patch.