og_forum_preprocess_node can insert wrong breadcrumbs by wrongly processing each node in og_ghp_ron view output
allenshaw - October 20, 2009 - 08:40
| Project: | OG Forum |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | paulbooker |
| Status: | reviewed & tested by the community |
Description
This function appears to run for every node returned by the og_ghp_ron view included on the group home page. As a result, it's rewriting the breadcrumb, repeatedly, for each item in the view.
Because of this, if the last item in the og_ghp_ron view is a forum post, the final state of the breadcrumb is what would be appropriate for that forum post, but not for the group home page.
My quick fix is to change this if() statement
if ($variables['type'] == 'forum') {to this
if ($variables['nid'] == arg(1) && $variables['type'] == 'forum') {May not be the most elegant fix; simply relies on the current nid to be at arg(1).

#1
I agree. Much better to check that $variables['page'] == TRUE or:
<?phpif (!empty($variables['page']) && $variables['type'] == 'forum') {
?>
#2
Patch attached.
#3
I'll get this committed to the development branch later today