Bug #26739
closed
TMENU_LAYERS produces identical layer IDs
Added by Markus Rathmayr over 13 years ago.
Updated over 11 years ago.
Category:
Content Rendering
Description
When creating a nested TMENU_LAYERS menu the function extProc_init in tmenu_layers.php produces identical IDs for sub-layers. I guess this is the case if the configuration of e.g. level 2 and 3 are identical.
This fixes the problem:
instead of:
$this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']) . 'x' : substr(md5('gl' . serialize($this->mconf)), 0, 6);
use:
$random = rand(1,100);
$this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']) . 'x' : substr(md5('gl' . $zufall.random($this->mconf)), 0, 6);
Sorry, error in the replacement code:
$random = rand(1,100);
$this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']) . 'x' : substr(md5('gl' . $random.serialize($this->mconf)), 0, 6);
- Target version changed from 4.5.3 to 4.5.4
- Target version changed from 4.5.4 to 4.5.5
- Target version changed from 4.5.5 to 4.5.6
- Category set to Content Rendering
- Status changed from New to Accepted
- Complexity set to easy
I would also rather go for some kind of internal counter mechanism here, which creates predictable ids - thus avoiding the temp flooding problem.
Could anybody provide a patch for that?
- Target version changed from 4.5.6 to 4.5.8
- Target version changed from 4.5.8 to 4.5.12
My solution was this one:
$this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']).$GLOBALS['TSFE']->register['count_HMENU_MENUOBJ'] . 'x' : substr(md5('gl' . serialize($this->mconf)), 0, 6).$GLOBALS['TSFE']->register['count_HMENU_MENUOBJ'];
- Status changed from Accepted to Rejected
With 6.1 issue #46358, the _layers menus where moved to statictemplates, and statictemplates was removed from core afterwards. This issue won't be solved in the core anymore.
Also available in: Atom
PDF