HMENU doesn't work with special=userfunction and expAll
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
entryLevel = 0
special = userfunction
special.userFunc = tx_ameos_navigation->makeMenuArray
1 = TMENU
expAll = 1
NO.allWrap = 1>|<br>
2 = TMENU
expAll = 1
NO.allWrap = 2->|<br>
3 = TMENU
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)
#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.
#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
- File pagetree.png View added
- File template-setup.txt View added
- File genericfunctions.php View added
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.
#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!