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.
I can't get the Reset button to work properly. I have a couple of views, with AJAX enabled, when I click the reset button, it just redirects me to /node.
I also tried manually creating the button as suggestion in http://drupal.org/node/99370 but the same thing happens, any ideas?
Just to add, the filter button works fine.
Comment | File | Size | Author |
---|---|---|---|
#11 | borked_reset_view.txt | 190.6 KB | dalin |
Comments
Comment #1
dawehnerMh this should really work.
Could you attach an export of your view? Perhaps there are some obvious things, which makes the troubles here.
Even better it would be if you could try to create a view with fields which are availible on a clean drupal installation, then it would be really easy to reproduce your problem and based on this it's probably easy to fix it in short time.
Comment #2
Web Assistant CreditAttribution: Web Assistant commentedI have a feeling it's something silly that I've done, below is the exported view. I should also add that I have the Views PHP module installed, and also I'm using hook_views_data to register my own table.
Comment #3
Web Assistant CreditAttribution: Web Assistant commentedI did what you suggested and created a fresh install of Drupal, with no other modules but ctools and views, created a simple view with exposed filters and reset button, but I still get the same problem.
If I create the view as a page instead of a block, the reset does work, but the page is being refreshed, and it doesn't reset via AJAX. With a block, clicking the reset button redirects to /node.
Also, strangely enough, the reset does work as expected in the Preview section of the Views edit page. I've only tried this on my localhost (xampp), so will now test this on my server, see if the problem is with my setup.
Below are the versions I'm using, can you replicate this at all?
Drupal = 7.7
Chaos tools = 7.x-1.0-rc1
Views = 7.x-3.0-rc1
Below is the exported view used in the clean install
Comment #4
Web Assistant CreditAttribution: Web Assistant commentedJust to update, this works as expected if the view type is page, rather than block, which is what I was using. Annoying, but at least it works.
Though, I should say, the reset button doesn't fire in AJAX.
Comment #5
samhassell CreditAttribution: samhassell commentedAs I mentioned at http://drupal.org/node/1278634, this is reproducible with Panels content panes:
"If you set up a views content pane display, and set 'Use Panel Path' to yes, then put this pane inside a panels layout, the reset button with ajax appears to work correctly until you change some settings and press 'apply'.
Pressing the reset button after this point will reload the page - sending the user to another views display, such as a page or a feed, if there are other displays, or / if there are no other attachments"
This popped up on the site I am working on and I have reproduced it on a vanilla d7 install with current devs of views & panels.
Cheers,
Sam.
Comment #6
samhassell CreditAttribution: samhassell commentedComment #7
grossmann CreditAttribution: grossmann commentedI could reproduce this with a block view and a taxonomy filter.
So subscribing here.
Comment #8
samhassell CreditAttribution: samhassell commentedthis appears to occur only when ajax is on.
Comment #9
samhassell CreditAttribution: samhassell commentedthis is in -dev
Comment #10
dalinI'm getting a slight variation on this bug. My view has multiple pairs of block and page displays. The block displays contain the exposed forms (AJAX) and the reset buttons. I'm using context module to render the block display below its matching page display. So there are 3 separate URLs in question, each of which contains both a page and block display. All from the same view.
When you click the reset button you are always redirected to the URL of the first page display. When I do a bit of debugging I see that this line:
reveals the problem
$this->view->current_display
is always 'block_1' regardless of what display I'm actually working with.Comment #11
dalinAttached is my exported view.
Comment #12
TechNikh CreditAttribution: TechNikh commentedsame thing here. Reset redirects to home page in block view with ajax enabled.
Comment #13
TechNikh CreditAttribution: TechNikh commentedI see that stable version 7.x-3.0 has released. Is this issue fixed there?
Comment #14
TechNikh CreditAttribution: TechNikh commentedEven 7.x-3.0 redirects to home page
the url is http://www.site-name.com/?op=Reset
Comment #15
OnkelTem CreditAttribution: OnkelTem commentedConfirming the bug.
When a view is the Content pane, and Panel Path is used, then Reset button doesn't work.
Comment #16
grossmann CreditAttribution: grossmann commentedThe funny thing is the reset button works perfectly in the views preview but as a content pane on a panel or a block it doesn't.
grossmann-mcs
Comment #17
dawehnerI'm pretty sure there is another issue about the path of panel panes out there, but you know because people are creating issues like crazy finding the right one is some kind of art.
#1144378: Allow Views 3 Pane content type to expose filter as a block, and replace "inherit path" setting with "override path" seems to be the right issue for panel panes.
Comment #18
grossmann CreditAttribution: grossmann commentedI tried it with exposed form in block = yes and the block on the same panel pane and the reset button worked. But it looks like he is not working with ajax but simply reloads the page on the panel path. Is there no possibility to make this work without moving the exposed filters to a separate block and the reset button reloads like here: http://www.mastersranking.com/pages/masters-finance.html (see comment here https://drupal.org/node/99370#comment-2465716)?
grossmann-mcs
Comment #19
jh81 CreditAttribution: jh81 commentedConfirmed #5 with 7.x-3.3. The reset filter button goes back to the page if it exists else it goes to \. Ajax turned off doesn't fix the error. I have multiple views in a quicktab so I can't use the Exposed form in block option.
Comment #20
acbramley CreditAttribution: acbramley commented+1 have this issue using insert_view so my view is in the body content of a node, reset button returns me to the homepage
Comment #21
Anonymous (not verified) CreditAttribution: Anonymous commentedAlso experiencing this.
Comment #22
gynekolog CreditAttribution: gynekolog commentedI use
<input type="reset" onClick="history.go(0)" value="Reset">
in views-exposed-form.tpl.phpComment #23
dshields CreditAttribution: dshields commentedI'm experiencing the very same issue.
When using exposed filters in a content pane, the reset button directs me to the homepage, url = /eng?title=&field_capacity_value[min]=1&field_capacity_value[max]=100&op=Reset
Comment #24
kclarkson CreditAttribution: kclarkson commentedI too am experiencing this issue. I am using panels for tons on node overrides and just noticed this.
Comment #25
mgiffordEDIT: Sorry, wrong thread.
Comment #26
mgiffordRemoving tags. Sorry.
Comment #27
helloworld2016 CreditAttribution: helloworld2016 commentedReproduced with a block view in a panel and a taxonomy filter. Subscribing here.
Comment #28
TechNikh CreditAttribution: TechNikh commentedThanks gynekolog
#22 works for me.
in views-exposed-form.tpl.php
Comment #29
7wonders CreditAttribution: 7wonders commented#22 #28 also works in a form alter
Comment #30
kclarkson CreditAttribution: kclarkson commentedIs there anyway this can be added as a patch ?
Would love to try and get this committed :)
Thanks,
Comment #31
imclean CreditAttribution: imclean commentedThe ajax click event (ajaxSubmit function) is not being bound to the reset button.
In views js/ajax_view.js the following only selects the first submit element:
Although I'm not sure this is the correct place to loop through all the submit elements.
See also #1109980: Exposed Form Reset button Inherits the page display URL when using as a block and AJAX
Comment #32
imclean CreditAttribution: imclean commentedTo clarify my situation:
- Views latest dev as of today
- Views block display
- Exposed filter
- ajax enabled (or exposed filter won't display)
Comment #33
gynekolog CreditAttribution: gynekolog commentedThis patch do same work like #29 #28 and #22.
Comment #33.0
gynekolog CreditAttribution: gynekolog commentedAdded extra info
Comment #34
MustangGB CreditAttribution: MustangGB commented