Bug #100319
closedMenu generation and ATagParams not respected in menu-generated-links runtimeCache
100%
Description
Between TYPO3 v11 and v12 the generation of the menu changed.
In https://review.typo3.org/c/Packages/TYPO3.CMS/+/72909 the handling of ATagParams was moved into AbstractMenuContentObject::menuTypoLink function, which is called from AbstractMenuContentObject::link function which uses a runtime cache. While building the cacheId the ATagParams is ignored. This leads to issues if you have 2 menues with different configs on this part, maybe more parameters aren't included in cacheId.
Maybe cross collision with removal of the cache in https://review.typo3.org/c/Packages/TYPO3.CMS/+/76384 it used an complete different way for cacheId calculation.
On my system it is a TypoScript main menu and a menu content element
My TypoScript:
lib.textmenu = HMENU
lib.textmenu {
1 = TMENU
1.wrap = <ul class="nav justify-content-center"> | </ul>
1.NO.wrapItemAndSub = <li class="nav-item"> | </li>
1.NO.ATagParams = class="nav-link"
1.expAll = 1
2 < .1
3 < .2
4 < .3
5 < .4
6 < .5
7 < .6
}
Updated by Benni Mack over 1 year ago
- Related to Bug #96486: HMENU: ATagParams is processed before the link is generated added
Updated by Nikita Hovratov over 1 year ago
I can confirm this. Happened on an upgrade to v12.
We have 2 menues, which generate the same menu items, but with different ATagParams (= different CSS classes).
The second menu is rendered with the CSS classes from the first menu.
How to reproduce:
- Create a styleguide Frontend tree
- Add this TypoScript:
page.2000 = HMENU page.2000 { special = directory special.value = 740 # insert your pid of the Styleguide Frontend root page 1 = TMENU 1 { NO = 1 NO.allWrap = <li class="nav-item">|</li> NO.ATagParams = class="nav-link" } }
- Open the frontend and inspect the menu
Expected: The menu items have the class "nav-link"
Actual: The class "nav-link" is missing
The first menu, which is rendered, is on the left side "mainNavigation".
Now add:
page.10.dataProcessing.10 >
And open the page again. The class "nav-link" is rendered, as there was no prior cache hit.
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79575
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79575
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79575
Updated by Masod Mohmand over 1 year ago
We can confirm this too. If you have two menus on your page generating the same menu but with different ATagParams.
The AtagParams from the first one is used. But it this does not happen on all pages.
lib.testNavigation = HMENU
lib.testNavigation {
1 = TMENU
1 {
expAll = 0
wrap = <ul class="mainnavigation">|</ul>
NO = 1
NO {
wrapItemAndSub = <li class="mainnavigation-item">|</li>
ATagParams = class="test-navigation"
}
}
}
lib.testNavigation1 = COA
lib.testNavigation1 {
wrap = <nav class="navbar">|</nav>
10 = HMENU
10 {
entryLevel = 0
wrap = <ul class="navbar-nav">|</ul>
1 = TMENU
1 {
expAll = 0
NO = 1
NO {
wrapItemAndSub = <li class="nav-item layout-{field:layout}">|</li>
wrapItemAndSub.insertData = 1
ATagTitle.field = subtitle // title
ATagParams = class="nav-link nav-link"
}
}
}
}
Updated by Gerrit Code Review over 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79575
Updated by Gerrit Code Review over 1 year ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79575
Updated by Gerrit Code Review over 1 year ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79575
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79672
Updated by Nikita Hovratov over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset dad7892423bf6e6bfe82c5c186367b651d0f9be1.