Running into an odd problem w/insert view:

I have a view setup with an exposed filter. When a user selects an item to filter on and clicks Apply, they're redirected to the front page of the site, and the view argument is appended to the front page URL.

ie: Assume node w/inserted view is at http://mysite.com/catalogue

When filter is submitted (say, publication type of Journal), user is dropped at the front page, with the following URL:

http://mysite.com/?field_pubtype[]=journal

This seems tangentially similar to http://drupal.org/node/383044 only in that case it sounds as though the filter was being applied correctly, instead of being dropped at the front page.

Comments

Pasqualle’s picture

this is the expected behavior of exposed filters #525592-2: views_embed_view() + exposed filters button = homepage redirect

if you switch the view into ajax mode, then the exposed filter will work as you wanted.
edit view->Basic settings->Use AJAX

mkelly’s picture

Status: Active » Closed (fixed)

Perfect! I missed that issue. Problem solved. Thank you.

tvb’s picture

Title: Insert view redirects to front page if view has an exposed filter » multilingual site with a view using exposed filters

I ran into a similar problem on a multilingual site with a view using exposed filters. The language path prefix in the URL disappeared after applying the filter.

Switching to Ajax mode solved it for me.

pvanerk’s picture

On this page is a bit of code available you can put in a custom module.

[Taken from the page above]
To solve this problem, I had to write the following module to alter the exposed form so that it submits to current language.

function mymodule_form_alter(&$form, $form_state, $form_id){
if($form_id=='views_exposed_form') {   
  global $language;
  $form["q"]["#value"]=$language->prefix."/".$form["q"]["#value"]; 
} 
}