I'm not sure if this is happening to anyone else but using the search functionality takes me to the groups page as if it was using the search to find a group, not find content within a group.

I'm wondering if this has to do with the fact that the group search didn't work anyway in the original module unless you added a page display to the search view. I"m wondering if the path for the page needs to be a certain way. I tried using og/search/% and also without the %.

Any help on this would be greatly appreciated.

Thanks,
tc

CommentFileSizeAuthor
#4 og_content_type_admin.patch1.64 KBensemble

Comments

idcm’s picture

we get a path like this when the search is executed.

http://mysailingadventures.com/og/search/?filter0=mission&op=Search+this...

We had to comment out the following until this issue can be resolved:

if (module_exists('search') && user_access('search content')) {
$post = drupal_get_form('og_content_type_admin_search_form', $node);
}

ensemble’s picture

Our site has this problem as well. I've been trying to play around with the views to see if I could get it working, but the best I can get is now there is an empty search page that always says "no results", instead of simply redirecting the Groups page. (I got that by adding a page to the og_search view with a path of og/search.) We've simply disabled the search box for now, but we really want to get it working. I'm hoping someone else will have a fix.

ensemble’s picture

Okay, I've been working on this issue, and I'm getting really close to the solution, but need some help getting the rest of the way.
(While I have some php and sql experience, this is my first real attempt at working with Drupal code, so forgive me if this is somewhat crude or if I'm not following some conventions.)

1) I added a page display to the og_search view, with a path of og/search

2) in the OG content type admin code, I modified the og_content_type_admin_search_form function - the first two lines are now

function og_content_type_admin_search_form($form_state, $group) {
  $form['keys'] = array(    ...

This gets things almost working. Now when I use the search box, it takes me to a URL like
/og/search/238?keys=testing&op=Search+this+group&form_build_id=form-c3aeb701f43fa84f03978068825bf3ac&form_token=1db417f5c62fe08a0caedc945f663322&form_id=og_content_type_admin_search_form
and I get to the right page, but it gives me "results not found".

If I take out everything at the end, leaving just the URL /og/search/238?keys=testing, then I get the search to work!

So here's the question: how can I get the form to not submit all of those extra variables (op, form_build_id, form_token, form_id)? I see in the source code the form uses the 'views_filters_process' function, which (from what I can tell) is supposed to get rid of the form_id and form_token, but that doesn't appear to work.

Any help will be greatly appreciated!

ensemble’s picture

StatusFileSize
new1.64 KB

I did end up making a fix for this. I've done very little work with Drupal code, so this might not be the best way to do things, but it's been up on our site for a month or two now, and it seems to work just fine.

  1. As mentioned above, I added a page display to the og_search view and gave it a path of og/search
  2. The attached patch has the changes I made to the module. (This is my first patch - I hope I did it correctly.)

If anyone else has a better way to do this, I'd be happy to learn!