I'm not sure it's an OG issue or Views.

1) In og_ghp_ron add filter Node:type
2) Expose the filter
3) Go to a group node, Select story and click apply

Instead of being redirected to example.com/node/xxx?type[]=story you are redirected to example.com/?type[]=story

Comments

amitaibu’s picture

It happens when AJAX is disabled.

amitaibu’s picture

Title: Exposed filter results with incorrect URL » Exposed filter can't work with og_ghp_ron

I've investigated some more. In og_views_view_group() we have $built = $view->preview('default', array($node->nid));.
However, since we are using the default view and not a page then Views doesn't get the node/% resulting with example.com/?title=123.

A workaround that I found, is to create a page view (with path og_ghp) and to change $built = $view->preview('page', array($node->nid));
Now the URL is resulting with example.com/og_ghp/1?title=123

However this is an ugly hack - any idea on how to make it nicer?

ultimateboy’s picture

Confirming this issue. A view with an exposed filter cannot be set as a group homepage unless ajax is enabled; otherwise, filtering the view using the exposed filter gives very undesired behavior.

grzegorz.bartman’s picture

I solved this with form alter:

function MODULENAME_form_alter(&$form, $form_state, $form_id) {
  // Modifications of exposed filter on group page.
  if($form_id == 'views_exposed_form' && menu_get_object()->type == 'group') {     // group - node type
    $form['#action'] = $_SERVER["REQUEST_URI"];
  }
}
donquixote’s picture

Hi. same behavior here.
Just enabled ajax, and now it works.
Still, would be nice if it can be fixed..

Grayside’s picture

Version: master » 7.x-1.x-dev

We use much the same trick, currently via Views Embed. Don't know if Views 3 offers a better trick.

amitaibu’s picture

Status: Active » Fixed

We no longer have custom special code from Views provided by OG, so it doesn't apply to OG7

Grayside’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Fixed » Active
Grayside’s picture

Status: Active » Fixed

http://drupalcode.org/project/og.git/commit/e19a9ff

Observed in testing that you can easily enter a confusing place if you have exposed filters that provide no results. #1429584: Support homepage views with no-result exposed filters

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.