Bug #28640
closedTMENU_LAYERS does not always create unique IDs for the third level
0%
Description
TMENU_LAYERS creates not unique IDs, if I use 2 TMENU_LAYERS menues.
Example:
temp.MENU_MAIN = HMENU
temp.MENU_MAIN {
entryLevel = 1
}
temp.MENU_MAIN.1 = TMENU_LAYERS
temp.MENU_MAIN.1 {
layerStyle = position:absolute;visibility:hidden;
lockPosition = x
...
}
temp.MENU_MAIN.2 = TMENU_LAYERS
temp.MENU_MAIN.2 {
layerStyle = position:absolute;visibility:hidden;
lockPosition = y
...
}
temp.MENU_MAIN.3 = TMENU
temp.MENU_MAIN.3 {
...
}
The IDs for the third level are not unique, if there are more entries/layers to display in the second and third level.
Example for the third level:
<div id="Menu1e532b0" style="z-index:9995; position:absolute;visibility:hidden;"><div class="menu1_main2"><a href="archiv.html" title="Archiv" onfocus="blurLink(this);">Archiv</a></div></div>
<div id="Menu1e532b0" style="z-index:9993; position:absolute;visibility:hidden;"><div class="menu1_main2"><a href="meldungen1.html" title="Meldungen" onfocus="blurLink(this);">Meldungen</a></div></div>
<div id="Menu1e532b1" style="z-index:9992; position:absolute;visibility:hidden;"><div class="menu1_main2"><a href="meldungen2.html" title="Meldungen" onfocus="blurLink(this);">Meldungen</a></div></div>
I have found a solution to fix this bug. The WMid makes the problems.
File: typo3/sysext/cms/tslib/media/scripts/tmenu_layers.php
The value for "$this->WMid" should contain more values.
I dont know which values so I have added a rand:
function extProc_init() {
$this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']).rand(0,99) . 'x' : substr(md5('gl' . serialize($this->mconf)), 0, 6).rand(0,99);
Note: the problem occurs not always. Some typo3 installations generate always a correct WMid.