Thank you for all your effort in Joomla. It is a great tool and I use use it for years now.
In manually building the breadcrumbs / pathway to a component view, Joomla may fail to retrieve the active menu item by e.g.
Thus $menu is unset in some scenarios.
Code: Select all
$menu = JFactory::getApplication()->getMenu()->getActive();
I do understand that this is expected behaviour whenever you create a (text) link with no menu itemID in the URI (though I would prefer a default, which is the frontpage; that could be optional for backwards compatibility).
But this also happens with menu item aliases created in the backend (at least if the alias and the menu item are in different menus):
- Create an menu item alias to a submenu item of a different menu.
- Use the alias on any frontend page that is NOT showing the aliased item menu. (The menu including the alias, e.g. to the user profile page, is displayed on all pages.)
-> The active menu will be empty.