Project

General

Profile

Actions

Bug #21493

closed

JSMENU's showActive is broken

Added by Jörg Wagner over 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Communication
Target version:
Start date:
2009-11-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The implementation of the JSMENUITEM property "showActive" is (very) flawed. It only works for a small subset of all possible HMENU configurations:
- Most HMENU.special variants (directory, list, browse,...) will stopp showActive from working.
- Any HMENU properties that change the menu to something other than a tree starting at the root page of the website (e.g. HMENU.entryLevel) will also break the function of showActive.
- Mountpoints in the root line will stopp showActive from working.

The problem is very simple to solve. The JSMENU code to determine if a page is active is found in /typo3/sysext/cms/tslib/class.tslib_menu.php:
$active = ($levelConf['showActive'] && $data['uid'] == $this->tmpl->rootLine[$count]['uid']);
This is very simplistic and will not work in any more complex cases (as listed above). The funny thing is that the same php file contains the method tslib_menu::isActive(), which does exactly (and does right) what JSMENU tries to do with the flawed approach above.
So simply replacing that line by...
$active = ($levelConf['showActive'] && $this->isActive($data['uid'], $MP_var));
...does the job.

Patches for 4.2.10 and 4.3.0beta2 are attached.
(issue imported from #M12505)


Files

Actions

Also available in: Atom PDF