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

Comments

michaek’s picture

Title: Breadcrumb May Generate Erroneous Entries » Breadcrumb Trail May Contain Erroneous Entries
michaek’s picture

StatusFileSize
new487 bytes

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

stockliasteroid’s picture

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

chriscohen’s picture

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.

sun’s picture

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.

Status: Fixed » Closed (fixed)

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

dandaman’s picture

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