Download & Extend

og_forum_preprocess_node can insert wrong breadcrumbs by wrongly processing each node in og_ghp_ron view output

Project:OG Forum
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:paulbooker
Status:closed (fixed)

Issue Summary

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).

Comments

#1

I agree. Much better to check that $variables['page'] == TRUE or:

<?php
if (!empty($variables['page']) && $variables['type'] == 'forum') {
?>

#2

Patch attached.

AttachmentSize
609274.patch 403 bytes

#3

Assigned to:Anonymous» paulbooker
Status:active» reviewed & tested by the community

I'll get this committed to the development branch later today

#4

Status:reviewed & tested by the community» fixed

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here