Closed (fixed)
Project:
Search configuration
Version:
5.x-1.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2007 at 21:52 UTC
Updated:
18 Sep 2007 at 14:32 UTC
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
Comment #1
canen commentedI've never used OG but this seems OK. I'll try and get this in soon. Thanks.
Comment #2
canen commentedAdded in commit #80022. Thanks. I haven't tested it yet though.
Comment #3
(not verified) commented