Project

General

Profile

Actions

Bug #24209

closed

Register count_MENUOBJ is not properly initialized

Added by Francois Suter over 13 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Category:
TypoScript
Target version:
-
Start date:
2010-11-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

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. The solution is to reset count_MENUOBJ properly, taking into account that one must not loose the count of the current menu when "coming back" from a submenu.

The following TS can be used to test 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 = ---|
}

It will show all the above-mentioned register. count_MENUOBJ is the last one. Observe how it has the same value as count_HMENU_MENUOBJ. Apply the patch and check again. Now count_MENUOBJ is incremented per menu.
(issue imported from #M16573)


Files

16573.diff (911 Bytes) 16573.diff Administrator Admin, 2010-11-26 10:17
16573_4-4_v2.diff (1.47 KB) 16573_4-4_v2.diff Administrator Admin, 2010-11-26 15:16
16573_trunk_v2.diff (1.54 KB) 16573_trunk_v2.diff Administrator Admin, 2010-11-26 15:16
Actions

Also available in: Atom PDF