Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I haven't had time to extensively test this, but I have a view set up with a number of exposed filters, that are also filtered using the selective exposed module. The reset button simply does not reset the filters.
Comment | File | Size | Author |
---|---|---|---|
#10 | 981994-views_hacks-reset-button.patch | 1.01 KB | snufkin |
Comments
Comment #1
infojunkie CreditAttribution: infojunkie commented* Is the view using Ajax?
* Is the exposed filter form placed on the page or in a block?
* Can you open Firebug and check if there's an error reported in the console? Both upon loading the page and when clicking Reset.
Thanks!
Comment #2
snufkin CreditAttribution: snufkin commentedThe view is not using ajax, the exposed filter is in the page.
No errors in firebug either.
One thing occurred to me, would it not be better to use standard drupal form api definition for the button? like this:
I will try to write a patch tomorrow.
Comment #3
cybermache CreditAttribution: cybermache commentedsubscribing
Comment #4
infojunkie CreditAttribution: infojunkie commentedThere's not enough information for me to find out why Reset is not working in your cases. You can send me a link to your online installations for me to take a look.
Comment #5
jamiehollernI'm having this issue also. When the button is clicked, nothing happens at all. My view isn't using AJAX although the filter is a block. No errors in Firebug.
Comment #6
infojunkie CreditAttribution: infojunkie commentedIt's possible that the button and form ids that the reset script is using are wrong. Can someone check this? E.g using
console.log(Drupal.settings.vfr)
and comparing the keys with existing form ids. Also, check that the reset button's id is indeed edit-reset in the page. Thanks!Comment #7
Les LimI'm fairly certain this is a duplicate of #946488: Views Filters Reset does not work when "Remember last setting" is checked.. If the filters in question here do not have the "Remember" option enabled, please re-open this issue.
Comment #8
infojunkie CreditAttribution: infojunkie commentedTo those having the problem here, can you confirm that you are using the "Remember last setting" option for your exposed filters?
Comment #9
cybermache CreditAttribution: cybermache commentedI don't have Ajax enabled and my exposed filter is in a block. Turning off the 'remember' option does bring back the reset capability, sort of. In my instance I have 7 options to filter with. If all of them are selected when I disable the 'remember' option then this will be what the reset button reverts to. If two are selected that will be the 'reset'. I have tried emptying my cache files and deselecting, saving, and re-selecting the 'reset' option in my view. These do not seem to have any affect. It seems like maybe this field is not being emptied successfully? I would agree that this is a duplicate of #946488 and that the suggestion there about changing the 'reset' button type might be a good place to start.
IMHO
Comment #10
snufkin CreditAttribution: snufkin commentedI got it fixed using the get_url() instead of get_path() on the views object. If the view uses arguments this substitutes them and thus redirects correctly (eg. old behaviour redirected me to taxonomy/term/%, this is fixed with this).
And using this issue because i did not have my remember last setting checked.
Comment #11
infojunkie CreditAttribution: infojunkie commentedSeems to work fine on my side. Committed to latest dev. Thanks!
Comment #12
sammo CreditAttribution: sammo commentedHi this didn't work for me.
I'm doing something quite complicated by using an exposed filter from the default display (in a block), to update the exposed filters of multiple block displays and page displays. The default display can not use ajax (there is no default page to update), so this is disabled by default, plus I need a page load anyway so that multiple blocks can update.
I'm not good with jQuery (yet) but a quick look had me change this code in the views_filters_reset.js file:
to this:
This has fixed the issue for me. Does this make sense? Should I roll a patch?
Thanks.
Comment #13
sammo CreditAttribution: sammo commentedComment #14
infojunkie CreditAttribution: infojunkie commentedRe #12: I don't understand what this code does. *After* it redirects the browser window to the reset URL, it clears the form and submits it? Is the original page still loaded at this point?
Comment #15
sammo CreditAttribution: sammo commentedWell if I change to code to:
It will only work if I click reset after I have been redirected - so I am clicking reset twice. I guess the reset needs to be called from the page it redirects to or else it doesn't work?
Comment #16
tanma CreditAttribution: tanma commentedHi there
First thanks for this great module, just what I needed!
Though I'm having some difficulty getting things to work as I think they are meant to?
Views Hacks 6.x-1.x-dev
Views 6.x-2.11
Core 6.17
I have a view with 8 exposed filters. 4 of them are Term ID (with depth) to get specific taxonomies. I installed the module and turned on the filter auto-submit which worked perfectly. But when I turned on filters reset, clicking on the Reset button doesn't seem to do anything, the filters were not reset
Not using ajax, the exposed filter is on a page, and firebug doesn't have any error on page load or reset click.
Neither do I have the "Remember" option enabled. I can give you access to the site if you want to check it out for yourself.
I thought the dev version might fix the prob....
Tan
Comment #17
ryank76 CreditAttribution: ryank76 commentedI'm having the same issue as #9:
My view is not in a block. 'Remember' is not enabled for either of my 2 filters.
I tried unchecking 'Force single' and unchecking all the checkboxes for the filter then disabling 'Remember', but this meant that when it resets it chooses every option instead of none.