It seems Menu Trails breaks some tokens, for example [ogname], which were being used for my Custom Breadcrumbs. Now, I'm not sure this is a bug, normal interaction with Custom Breadcrumbs, or what, but I thought I would start by posting here, and see where it would lead.

Here's what I am trying to achieve: I'm building a site with several Organic Groups. Each of those has a "News and Events" page, which is a View pulling teasers of a "News or Event" CCK node type. What I'd like to happen is that, when viewing a "News or Event", the appropriate OG menu shows, and the breadcrumb reads something like "Home > Group Name > News and Events".

Menu Trails almost sorts out the first requirement -- I can get the right OG menu showing, though the "News and Events" page is not highlighted.

The second one is odd. I've used Custom Breadcrumbs before to sort this kind of thing out on non-OG sites, so I thought I would at least try it here. Strangely, tokens like [ogname], [menu], or even [menu-trail-parents-raw] do not work once Menu Trails is installed. When it gets to those tokens, Custom Breadcrums simply displays nothing at all, as if the output of that token is an empty string.

Even if Menu Trails is installed, but not configured, it still immediately breaks the Custom Breadcrumb.

I would appreciate any thoughts on what is going on here.

Many thanks in advance,

nemchenk

CommentFileSizeAuthor
#4 menutrails-DRUPAL-6--1.og-groups.patch854 bytessun
#2 632070.patch617 bytesnemchenk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nemchenk’s picture

It's not just Custom Breadcrumbs -- Menu Trails makes Pathauto loose those tokens too...

nemchenk’s picture

Category: support » bug
Status: Active » Needs review
Issue tags: +pathauto
FileSize
617 bytes

Ok, I've figured out what is going wrong: menutrails.module actually uses array_shift() to "pop" the group off $node->og_groups in menutrails_node_location($node). Thus, by the time Custom Breadcrumbs and Pathauto get called, the node no longer has a group, thus [ogname] is blank etc etc.

I attach a patch against 6.x-1.0 which uses array_unshift() to push the group back on.

Anonymous’s picture

This patch correctly reattaches the group to the node and the tokens in Pathauto work once again, thanks nemchenk.

Can someone else check this?

sun’s picture

Status: Needs review » Fixed
FileSize
854 bytes

Thanks for reporting, reviewing, and testing! Committed attached patch.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

nemchenk’s picture

Glad to help :) Thanks to chrisdolby for testing.

Status: Fixed » Closed (fixed)
Issue tags: -breadcrumbs, -pathauto, -Organic Groups

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