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.
Problem/Motivation
Views in D7 had a nifty 'auto-submit' option for the basic exposed form plugin, which leveraged the small js library in Ctools with the same name.
Proposed resolution
Since Ctools 8.x probably doesn't want/need small features like this anymore, let's copy over the code and add the option in BEF.
Remaining tasks
Review the patch.
User interface changes
A new 'Autosubmit' option is added to he BEF exposed filter plugin.
API changes
Nope.
Data model changes
Nope.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2764981-2-6.interdiff.txt | 4.29 KB | mikeker |
#6 | 2764981-6-autosubmit.patch | 6.73 KB | mikeker |
#2 | 2764981-better-exposed-filters-autosubmit.patch | 6.7 KB | amateescu |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Chapter Three commentedThis should do it.
Comment #3
dawehnerIn an ideal world I would have written an object doing that kind of stuff, rather than just putting the entire logic into an behaviour
This stuff should not use classes but rather data attributes. Classes are meant for styling purposes. At least this is what core is doing now more and more.
Comment #4
mikeker CreditAttribution: mikeker as a volunteer commentedThank you for the patch, @amateescu, and the review, @dawehner!
Setting to NW based on #3. I'll try to find time this week to make those changes but will happily commit if someone beats me to it!
Comment #5
ABaier CreditAttribution: ABaier commentedWould love to see that feature also. Looking forward!
Comment #6
mikeker CreditAttribution: mikeker as a volunteer commentedAddresses #3.2 (moves JS interactions from classes to data attributes). Would love to have another set of eyes look/test this as I don't have the bandwidth for more complete testing at the moment.
Speaking of which, were there any automated tests for this in D7's CTools? I'm guessing not...
I'll look into #3.1 later today but I'm not opposed to committing this without that change as there are a few other BEF bits that could use a similar refactor.
Comment #7
dawehnerSure we can always do that later.
One follow up which could be open is to provide some form of javascript test coverage.
Comment #9
mikeker CreditAttribution: mikeker as a volunteer commentedCommitted. Thank you!
Comment #10
mikeker CreditAttribution: mikeker as a volunteer commentedOpened #2776801: BEF needs automated Javascript tests as a followup.