Project

General

Profile

Actions

Bug #24209

closed

Register count_MENUOBJ is not properly initialized

Added by Francois Suter over 13 years ago. Updated almost 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 #1

Updated by Francois Suter over 13 years ago

Note: the behavior of count_HMENU_MENUOBJ is rather weird (it is increased properly but contains surprising values), but that would be a separate RFC.

Actions #2

Updated by Francois Suter over 13 years ago

Committed to 4.3 (revision 9648), 4.4 (revision 9649) and trunk (revision 9650)

Actions #3

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions #4

Updated by Simon Schaufelberger almost 2 years ago

  • Description updated (diff)
  • Category deleted (Communication)
  • Target version deleted (0)
Actions #5

Updated by Simon Schaufelberger almost 2 years ago

  • Description updated (diff)
Actions #6

Updated by Simon Schaufelberger almost 2 years ago

  • Description updated (diff)
Actions #7

Updated by Simon Schaufelberger almost 2 years ago

  • Category set to TypoScript
Actions

Also available in: Atom PDF