Author: Jonathan.Wage
Date: 2010-02-05 04:47:16 +0100 (Fri, 05 Feb 2010)
New Revision: 27584

Modified:
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
Log:
[1.4][sfSympalPlugin][1.0] Adding check for when no menus exist


Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
      2010-02-04 21:49:50 UTC (rev 27583)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalMenuPlugin/lib/menu/sfSympalMenuSiteManager.class.php
      2010-02-05 03:47:16 UTC (rev 27584)
@@ -228,11 +228,14 @@
     {
       $this->_menuItems = 
Doctrine_Core::getTable('sfSympalMenuItem')->getMenuHierarchies();
 
-      foreach ($this->_menuItems as $menuItem)
+      if (count($this->_menuItems) > 0)
       {
-        $this->_rootSlugs[$menuItem['root_id']] = $menuItem['slug'];
-        $this->_rootMenuItems[$menuItem['root_id']] = $menuItem;
-        $this->_hierarchies[$menuItem['root_id']] = $menuItem['__children'];
+        foreach ($this->_menuItems as $menuItem)
+        {
+          $this->_rootSlugs[$menuItem['root_id']] = $menuItem['slug'];
+          $this->_rootMenuItems[$menuItem['root_id']] = $menuItem;
+          $this->_hierarchies[$menuItem['root_id']] = $menuItem['__children'];
+        }
       }
 
       if ($cache = $this->_getCache())

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to