Bug #17158

HMENU doesn't work with special=userfunction and expAll

Added by Raphael GEYER over 12 years ago. Updated 3 months ago.

Needs Feedback
Must have
Target version:
Start date:
Due date:
% Done:


TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


The generated menu displays sub-pages for each item which doesn't have a _SUB_MENU entry in the given menuArr.
The added sub-pages are taken from the page tree.

This behaviour can be reproduced by using the function makeMenuArray from the TSref and some TS code like the following (you need also to have some pages created at level 1) :

includeLibs.tx_ameos_navigation = fileadmin/class.tx_ameos_navigation.php

lib.menu_haut = HMENU
lib.menu_haut {
entryLevel = 0
special = userfunction
special.userFunc = tx_ameos_navigation->makeMenuArray

1 {
expAll = 1
NO.allWrap = 1>|<br>
2 {
expAll = 1
NO.allWrap = 2->|<br>
3 {
expAll = 1
NO.allWrap = 3-->|<br>


The joined patch adds a new test which allows the the generation of the sub pages only if there is a _SUB_MENU entry.

Is this the right way to correct this or are there any hidden things ?
I'm not sure everything is right this way because start and makeMenu should use the HMENU array and also check for _SUB_MENU and this is not the case ...
(issue imported from #M5304)

ameos_menu.patch View (853 Bytes) Administrator Admin, 2007-03-27 12:26

pagetree.png View (41.7 KB) Morten Pless, 2015-10-15 15:53

template-setup.txt View (637 Bytes) Morten Pless, 2015-10-15 15:53

genericfunctions.php View (1.84 KB) Morten Pless, 2015-10-15 15:53


#1 Updated by Alexander Opitz about 6 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

#2 Updated by Bas van Beek almost 6 years ago

When creating 3 levels of menu items by a custom PHP script the third level displays also menu items that are coming from standard TYPO3 pages (from the root line).

After manually patching the file typo3/sysext/cms/tslib/class.tslib_menu.php the issue has been resolved.

This is issue is happening in TYPO3 4.5.29. Not yet tested 4.7 branch.

#3 Updated by Alexander Opitz almost 6 years ago

  • Category set to Frontend
  • Status changed from Needs Feedback to New

#4 Updated by Benni Mack over 4 years ago

  • Is Regression set to No

hey, could you provide a patch for 6.2/master?

#5 Updated by Benni Mack over 4 years ago

  • Status changed from New to Needs Feedback


can you recheck this please with the current master?

Just from reading, the userfunction needs to deliver the right information so the TYPO3 Core code knows that a submenu is available for an item.

#6 Updated by Alexander Opitz about 4 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

#7 Updated by Morten Pless almost 4 years ago

I think this bug should be fixed.
There is no point having special = userfunction if it doesn't behave.

I have attached files to help you reproduce this faulty behaviour in a clean 6.2.15 install

#8 Updated by Felix Richter over 2 years ago

  • Priority changed from Should have to Must have
  • TYPO3 Version changed from 4.1 to 7
  • PHP Version changed from 4.3 to 5.6

This bug is present in 7.6.15 again.
I am rendering an menu with the array provided by my userfunction. If array entry with key _SUB_MENU is empty, Typo3 ignores this and renders subpages into the menu, that exist in the page tree. So in my case there are pages in the menu, that should not be there.

#9 Updated by Riccardo De Contardi over 2 years ago

  • Status changed from Closed to New

#10 Updated by Sybille Peters over 1 year ago

Thank you for your report.

Even though it has been some time, would you consider checking if your patch idea is still up to date and upload it to our Gerrit review server?

Someone could do this for you, but I am thinking you might like the opportunity to contribute to TYPO3 yourself.

You can find a description of the TYPO3 contribution workflow here: https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/

Hint: If you get stuck anywhere, ask on Slack in the #typo3-cms-coredev channel. You can register in the TYPO3 slack workspace here: https://forger.typo3.com/slack

Also, if your issue is no longer reproducable, please let us know in the slack channel, so that this issue can be closed.

Thank you in advance!

#11 Updated by Benni Mack 3 months ago

  • Status changed from New to Needs Feedback

Hey everybody,

IMHO this is fixed in v9 (and probably before), can you please confirm this?

Looking at the code this is now taken into account.

Also available in: Atom PDF