IceMegaMenu bug

Hi. For some reasons, on my website when opening URLs like component/content/?id=65&Itemid=204 where 204 is Itemid that not exists in menus table, IceMegaMenu makes an infinite loop and hangs all my website. It executes infinite SQL requests "SELECT id,parent_id FROM #__menu WHERE id = 204" that can't give any result, because "id = 204" not exist in my table. My solution was to add " else break;" code in menucore.php in this place:

function getCurrentMenuItem()
{
global $mainframe;
$itemId = JRequest::getInt("Itemid",0);
if(!empty($itemId))
{
$db_temp = JFactory::getDBO();
$db = &$db_temp;
$parent = $itemId;
while($parent >0)
{
$query = "SELECT id,parent_id FROM #__menu WHERE id = ".$parent;
$db->setQuery($query);
$row = $db->loadObject();
if(!empty($row))
{
$parent = $row->parent_id;
if($parent == 1)
{
$itemId = $row->id;
}
} else break;
}
$this->_currentItemId = $itemId;
}
}
Responses (1)
  • Accepted Answer

    Tuesday, September 06 2016, 09:59 AM - #Permalink
    Hello,

    Your input on this issue is much appreciated. In the future, we might find this useful.
    Unfortunately, we have dropped Support for IceMegaMenu Module since early 2015.

    If you feel this bug could be site-breaking, the only thing we can advise is for you to change your Menu Extension.

    I would also advise for you to not use URLs like that, but instead use SEF URLs. Even with Joomla default SEF, you should have cleaner URLs. This will rate you higher on Google, and maybe you will not experience the issue reported with IceMegaMenu, as you should see a 404-not found page.

    Let me know if I can assist you with anything else,
    Regards
    The reply is currently minimized Show
Your Reply

Start your 7 days Free Trial Today!