Getting default menu item bug

panasenko
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon May 24, 2010 9:42 am

Getting default menu item bug

Postby panasenko » Mon Feb 06, 2012 4:12 pm

Hello. I found a bug in getDefault() method of JMenu class. When I tried to do following I received other than I wanted:

Code: Select all

$isMain = $menu->getActive() == $menu ->getDefault($this->language);

In the template $this->language contains code of current language like 'uk-ua', 'en-gb'. But getDefault() method needs to receive code like 'uk-UA', 'en-GB'. Then when I wrote:

Code: Select all

$isMain = $menu->getActive() == $menu ->getDefault('uk-UA');

all work well.

P.S. JFactory::getDocument->getLanguage() contains the same ('uk-ua' and 'en-gb').

Return to “Joomla! 2.5 Beta Support”

Who is online

Users browsing this forum: No registered users and 1 guest