The Joomla! Forum ™






Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Jun 25, 2007 1:45 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri May 04, 2007 3:58 am
Posts: 13
Location: Maryland, US
When creating a new menu with links (Menu Item Type "Alias") that point to another menu - for example, setting up a "footer menu" with a link to the Home page - that link will not display.  Space will be reserved for the menu item.

This Only occurs when the mod_mainmenu is set to display in a legacy format. See Attached Screens


You do not have the required permissions to view the files attached to this post.


Last edited by Jinx on Wed Oct 03, 2007 1:55 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Jun 25, 2007 2:01 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri May 04, 2007 3:58 am
Posts: 13
Location: Maryland, US
OK - To Solve my own bug:

In modules\mod_mainmenu\legacy.php:

Lines 25-60 currently are:

Code:
   // Menu Link is a special type that is a link to another item
   if ($mitem->type == 'menulink')
   {
      $menu = &JMenu::getInstance();
      if ($tmp = $menu->getItem($mitem->link)) {
            $name = $mitem->name;
            $mid = $mitem->id;
            $parent = $mitem->parent;
            $mitem = clone($tmp);
            $mitem->name = $name;
            $mitem->mid = $mid;
            $mitem->parent = $parent;
      } else {
         return;
      }
   }

   switch ($mitem->type)
   {
      case 'separator' :
         break;

      case 'url' :
         if (eregi('index.php\?', $mitem->link)) {
            if (!eregi('Itemid=', $mitem->link)) {
               $mitem->link .= '&Itemid='.$mitem->id;
            }
         }
         break;

      default :
         $mitem->link = 'index.php?Itemid='.$mitem->id;
         break;
   }


Change to:

Code:
   switch ($mitem->type)
   {
      case 'separator' :
         break;

      case 'url' :
         if (eregi('index.php\?', $mitem->link)) {
            if (!eregi('Itemid=', $mitem->link)) {
               $mitem->link .= '&Itemid='.$mitem->id;
            }
         }
         break;
      case 'menulink' :

         break;
      default :
         $mitem->link = 'index.php?Itemid='.$mitem->id;
         break;
   }


It looks like the menuLink item is pre-parsed to be appropriate for the legacy system, and there is no need to re-build the link.

Please confirm fix.


Top
 Profile  
 
PostPosted: Mon Jul 02, 2007 1:30 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Wed Sep 21, 2005 9:25 am
Posts: 1544
Location: Thailand
It looks like the call to getItem() is wrong - getItem() expects an int $id and not the whole link.  I tested this and saw $id as index.php?Itemid=50, so this could be a part of the problem also.

Code:
<?php
   // Menu Link is a special type that is a link to another item
   if ($mitem->type == 'menulink')
   {
      $menu = &JMenu::getInstance();
      if ($tmp = $menu->getItem($mitem->link)) {
            $name = $mitem->name;
            $mid = $mitem->id;
            $parent = $mitem->parent;
            $mitem = clone($tmp);
            $mitem->name = $name;
            $mitem->mid = $mid;
            $mitem->parent = $parent;
      } else {
         return;
      }
   }
?>

_________________
Sell Memberships and Subscriptions to Premium Content, Digital Goods, and Online Services.
http://oursitesolution.com


Top
 Profile  
 
PostPosted: Wed Oct 03, 2007 1:54 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
This problem seems to be fixed on SVN already, closing down.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group