Fixed bug #16573: Register count_MENUOBJ is not properly initialized
authorFrancois Suter <francois.suter@typo3.org>
Fri, 26 Nov 2010 14:14:05 +0000 (14:14 +0000)
committerFrancois Suter <francois.suter@typo3.org>
Fri, 26 Nov 2010 14:14:05 +0000 (14:14 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9650 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/cms/tslib/content/class.tslib_content_hierarchicalmenu.php

index f78adec..8b83114 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-26  Francois Suter  <francois@typo3.org>
+
+       * Fixed bug #16573: Register count_MENUOBJ is not properly initialized
+
 2010-11-26  Steffen Kamper  <steffen@typo3.org>
 
        * Fixed bug #16487: modulemenu.js breaks livesearch "Show all" when already in list module (Thanks to Andreas Kiessling)
index a0fb806..eae92fe 100644 (file)
@@ -1386,7 +1386,13 @@ class tslib_menu {
 
                        if ($submenu->start($this->tmpl, $this->sys_page, $uid, $this->conf, $this->menuNumber+1, $objSuffix))  {
                                $submenu->makeMenu();
+                                       // Memorize the current menu item count
+                               $tempCountMenuObj = $GLOBALS['TSFE']->register['count_MENUOBJ'];
+                                       // Reset the menu item count for the submenu
+                               $GLOBALS['TSFE']->register['count_MENUOBJ'] = 0;
                                $content = $submenu->writeMenu();
+                                       // Restore the item count now that the submenu has been handled
+                               $GLOBALS['TSFE']->register['count_MENUOBJ'] = $tempCountMenuObj;
                                $GLOBALS['TSFE']->register['count_menuItems'] = count($this->menuArr);
                                return $content;
                        }
index 4832f4c..dc941be 100644 (file)
@@ -57,6 +57,7 @@ class tslib_content_HierarchicalMenu extends tslib_content_Abstract {
 
                                $GLOBALS['TSFE']->register['count_HMENU']++;
                                $GLOBALS['TSFE']->register['count_HMENU_MENUOBJ'] = 0;
+                               $GLOBALS['TSFE']->register['count_MENUOBJ'] = 0;
                                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'] = array();
                                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId'] = array();