Bug #22478
closed
count_menuItems not working correctly
Added by Frederic Gaus over 14 years ago.
Updated about 6 years ago.
Description
It seems that count_menuItems is set to the count of subpages when a submenu is rended. After rendering the submenu, the value is not resettet to the correct count of menu items inside the upper menu. This causes a wrong count_menuItems when rendering a menu with submenus.
Okay, a bit difficult to explain. But I've taken a screenshot and this will hopefully explain what I mean.
There is a prefix in front of each menu point, set to the following values:
{register:count_menuItems}-{register:count_HMENU_MENUOBJ}-{register:count_MENUOBJ}
(issue imported from #M14143)
Files
By the way, this behavior could be fixed by changing line 1357 in file
/sysext/cms/tslib/class.tslib_menu.php:
$content = $submenu->writeMenu();
$GLOBALS['TSFE']->register['count_menuItems'] = count($this->menuArr);
return $content;
This is also completely untested but I attached a screenshot how the rendering of my menu has changed with this small fix.
For further testers, here's a sample TS that shows the issue:
lib.someMenu = HMENU
lib.someMenu {
1 = TMENU
1 {
expAll = 1
wrap = <ul>|</ul>
NO {
wrapItemAndSub.cObject = TEXT
wrapItemAndSub.cObject.value = |
wrapItemAndSub.cObject.noTrimWrap = |<li>({register:count_menuItems} - {register:count_HMENU_MENUOBJ} - {register:count_MENUOBJ}) |</li>|
wrapItemAndSub.cObject.insertData = 1
}
}
2 < .1
2.NO.wrapItemAndSub.cObject.value = -|
3 < .1
3.NO.wrapItemAndSub.cObject.value = ---|
}
Add it to your site, check out the first number, apply the patch and re-check the first number.
Committed to:
- TYPO3_4-3 in revision 8731
- TYPO3_4-4 in revision 8732
- TRUNK in revision 8733
- Status changed from Resolved to Closed
Also available in: Atom
PDF