Exposed filters not remembered after submit

pkej - August 16, 2007 - 10:23
Project:editablefields
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:markfoodyburton
Status:active
Description

I've got a filter where I'm filtering the pagetitle of nodes I want to edit. I noticed that after submitting I was not taken back to the filtered view, but to the default value in the filter.

#1

markfoodyburton - September 7, 2007 - 13:31
Assigned to:Anonymous» markfoodyburton
Status:active» postponed (maintainer needs more info)

Owe
Yes... Mmmm... I'm going to need some time and help to figure it out - it sounds easy to fix though...

#2

Hanno - May 21, 2008 - 22:49
Status:postponed (maintainer needs more info)» active

Any progress on this issue? I am experiencing the same behavior.
when I update an filtered view the url changes after update from
/?q=exampleview&filter0=1234
to
/?q=exampleview

Is it possible to get back to the same url after update?

#3

yngvewb - August 6, 2008 - 12:46

The same is happening to me. This also happends if you do an editing with pager on (editing page 2,3 etc), it always return to the first page after a update. I guess we can handle this with reading the referer URL and return to the referer after the update.

#4

cogapp_alx - June 2, 2009 - 14:15

This is happening because no #redirect property is being set on the form; by default, I think a form will redirect to the page it came from, but losing any variables that were in the querystring. I put this workaround in a bespoke module's hook_form_alter, though the code could easily be worked into editablefields.module too:

// make sure forms with editable fields redirect back to same page
if (strpos($form_id, 'editablefields-')!==false) {
    $redirect = explode('?', request_uri()); // get current page as array, comprising path and querystring
    $redirect[0] = substr($redirect[0], 1); // strip off leading slash to avoid address mangling
    $form['#redirect'] = $redirect; // set redirect
}

 
 

Drupal is a registered trademark of Dries Buytaert.