I'm in the process of adapting the modules Relativity and Wikitools to allow each group to have their own hierarchy-based wiki, and I noticed that both Relativity and OG User Roles modify the URL for adding a node, in incompatible ways.
Relativity wants the URL to be like: node/add/$node-type/parent/$parent-nid
The group membership automatically adds the query parameter: gids[]=$group-nid
This will work so far, but OG User Roles wants to change it to: ognodeadd?type=$node-type&gids[]=$group-nid
which wipes out the parent node info.
Fortunately, Relativity also allows the parent node info to go as a query parameter, parent_node. To get Relativity and OG User Roles (and OG Forums as well, although I never tested this) to work together seemlessly, I only had to add a single piece of code to line 673 of "og_user_roles.module":
//Modification to make it work with module "Relativity"
if (module_exists('relativity')) {
if (arg(3) == 'parent' && is_numeric(arg(4))) {
$query .= '&parent_node='.arg(4);
}
elseif (!empty($_GET['parent_node'])) {
$query .= '&parent_node='.$_GET['parent_node'];
}
}
This goes after the code to allow the module to work with forums and before the call to "drupal_goto()".
Comments
Comment #1
somebodysysop commentedCode will be included in 2.2 release.
Thanks so much for the contribution!
Comment #2
somebodysysop commentedAdded to 2.2 release. Thanks again for the code.