og_vocab seems to lack a function to remove categories that the user is not subscribed to from the search_form. Furthermore, even if it could, search_config rebuilds the taxonomy and would ignore og_vocab/vice versa. My solution was to patch the search_config module with og_vocab support and make them work together.

After line 104 in search_config.module:

$terms = variable_get('search_config_disable_category', array());

Insert the following:

            if (module_exists('og_vocab')) {
              $groupnode = og_get_group_context();
              $sql = "SELECT t.tid FROM {vocabulary} v, {term_data} t LEFT JOIN {og_vocab} ov ON v.vid = ov.vid WHERE (v.module = 'og_vocab' AND ov.nid != %d) AND t.vid=v.vid";
              $result = db_query($sql, $groupnode->nid);

              while ($row = db_fetch_object($result)) {            
                $terms[$row->tid] = $row->tid;
              }          
            }

Also posting this as an og_vocab issue.

Comments

canen’s picture

I've never used OG but this seems OK. I'll try and get this in soon. Thanks.

canen’s picture

Status: Needs review » Fixed

Added in commit #80022. Thanks. I haven't tested it yet though.

Anonymous’s picture

Status: Fixed » Closed (fixed)