Project

General

Profile

Actions

Bug #22478

closed

count_menuItems not working correctly

Added by Frederic Gaus over 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-04-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Bildschirmfoto 2010-04-17 um 15.06.53.png (117 KB) Bildschirmfoto 2010-04-17 um 15.06.53.png Administrator Admin, 2010-04-17 15:14
menu_after_changing_submenu_call.png (118 KB) menu_after_changing_submenu_call.png Administrator Admin, 2010-04-17 15:24
class.tslib_menu.php.patch (2.46 KB) class.tslib_menu.php.patch Administrator Admin, 2010-05-04 17:39
Actions #1

Updated by Frederic Gaus over 14 years ago

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.

Actions #2

Updated by Francois Suter over 14 years ago

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.

Actions #3

Updated by Francois Suter about 14 years ago

Committed to:
  • TYPO3_4-3 in revision 8731
  • TYPO3_4-4 in revision 8732
  • TRUNK in revision 8733
Actions #4

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF