[TYPO3-core] RFC #16573: Bug: Register count_MENUOBJ is not properly initialized
François Suter
fsu-lists at cobweb.ch
Fri Nov 26 10:22:39 CET 2010
This is an SVN patch request.
Type: Bugfix
Bugtracker references:
http://bugs.typo3.org/view.php?id=16573
Branches:
Trunk, 4.4, 4.3
Problem:
HMENU provides three registers: count_menuItems, count_HMENU_MENUOBJ and
count_MENUOBJ.
count_menuItems is meant to provide the number of items in the current menu.
count_HMENU_MENUOBJ is meant to provide the current number of a menu
item with regards to the whole HMENU.
count_MENUOBJ does the same but for inside the current menu.
count_MENUOBJ is not properly initialized on each menu/submenu and thus
contains the same value as count_HMENU_MENUOBJ.
Solution:
Reset count_MENUOBJ properly, taking into account that one must not
loose the count of the current menu when "coming back" from a submenu.
Notes:
1) Use the following TS to test:
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 = ---|
}
2) The behavior of count_HMENU_MENUOBJ is rather weird (it is increased
properly but contains surprising values), but that would be a separate RFC.
3) The only thing I'm a bit worried about is that fixing this problem
may break TS for people who relied on the erroneous behavior. Should we
be concerned about this?
Cheers
--
Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16573.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101126/61bb56f8/attachment.txt>
More information about the TYPO3-team-core
mailing list