Breadcrumb Trail May Contain Erroneous Entries

michaek - April 6, 2009 - 22:25
Project:Menu Trails
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Because _menutrails_recurse_crumbs() modifies $above within the foreach loop, it can lead to displaying erroneous items as ancestors of the current page in the breadcrumb trail. It's easy to fix this by passing a modified $above array to the recursive call, without modifying the value of $above within the loop. See attached diff (against current 6.x-1.x-dev).

AttachmentSize
1_fix_recurse_above_conflict.diff468 bytes

#1

michaek - April 6, 2009 - 22:26
Title:Breadcrumb May Generate Erroneous Entries» Breadcrumb Trail May Contain Erroneous Entries

#2

michaek - April 8, 2009 - 19:06

Updated patch. In previous version, when $above is empty, "$above + $menu_item" replaces $above with $menu_item.

AttachmentSize
1_fix_recurse_above_conflict.diff 487 bytes

#3

stockliasteroid - May 4, 2009 - 17:36

I can confirm that this is a problem, and that this patch does correct it. Thanks, michaek!

#4

chris.cohen - July 16, 2009 - 14:42

I fell foul of this bug and I can confirm that this patch solved it for me. To elaborate on the problem, suppose I have a menu as follows:

  • Apple
  • Banana
    • Orange
    • Pear
  • Fig

When navigating to Fig, the crumb is displayed as Banana -> Fig, instead of just Fig.

#5

sun - July 24, 2009 - 15:04
Status:needs review» fixed

Thanks for reporting, reviewing, and testing! Committed to 6.x.

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

#6

System Message - August 7, 2009 - 15:10
Status:fixed» closed

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

#7

dandaman - September 3, 2009 - 23:26

sun,

This seems to be a pretty big bug that is annoying a lot of people. I would think it might be helpful to put out a new release of Menu Trails. Is that possible? Is there a plan to put out a new release?

Thanks,

Dan

 
 

Drupal is a registered trademark of Dries Buytaert.