Project

General

Profile

Actions

Bug #21494

closed

JSMENU does not respect mount point overlays

Added by Jörg Wagner over 14 years ago. Updated almost 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

JSMENU calculates wrong links for its menu items if the link is an overlay mount point. So if the checkbox "Substitute Mount Point (this page) with Mounted page" is checked in the page properties of a mount point page, the JSMENU creates a wrong link (the "&MP=" variable in the query string is completely missing).

The algorithm for JSMENU link generation in /typo3/sysext/cms/tslib/class.tslib_menu.php only accounts for normal mount points (adding mounted children to a page) but completely ignores the possibility of overlay mount points. The attached patch (for 4.2.10 and 4.3.0beta2) is thoroughly tested in a bunch of JSMENU configurations.
(issue imported from #M12506)


Files

patch4.2.10_jsmenu_mpovl.diff (1.44 KB) patch4.2.10_jsmenu_mpovl.diff Administrator Admin, 2009-11-08 18:54
patch4.3.0beta2_jsmenu_mpovl.diff (1.44 KB) patch4.3.0beta2_jsmenu_mpovl.diff Administrator Admin, 2009-11-08 18:54
patch4.3.0RC1_jsmenu_mpovl_V2.diff (1.74 KB) patch4.3.0RC1_jsmenu_mpovl_V2.diff Administrator Admin, 2009-11-19 11:21
patch4.2.10_jsmenu_mpovl_V2.diff (1.74 KB) patch4.2.10_jsmenu_mpovl_V2.diff Administrator Admin, 2009-11-19 11:22
TS setup for testing.txt (1.44 KB) TS setup for testing.txt Administrator Admin, 2009-11-23 22:48
Actions #1

Updated by Jörg Wagner over 14 years ago

Please find attached a revised version of my patch (V2).
During additional testing for a posting in the core team group I found a constellation that the original patch did not account for. Explanation of the change can be found below.
Additionally the 4.3 patch is raised from beta to RC1.

Cheers, Jörg.


Explanation of the change:
During further testing I found that the indeces in array $menuItems have inconsistent meaning on first call level compared to all deeper (recursive) levels. This is a design weakness in the JSMENU code (which isn't very bright anyway).

Details:
On first entrance into function generate_level() the array $menuItems uses a precalculated content. The indeces of that content start at 0 and are numbered consecutively.
On recursive calls the function fills the array itself and the indeces then are the UIDs of the contained pages.
I was not aware of that poor design and did not account for it in the first version of my patch. All my testing contained mount points only on levels deeper than 1 and so it did not reveal that additional problem.

Actions #2

Updated by Jörg Wagner over 14 years ago

To easily reproduce the problem and its cure take these steps:

- build a page tree like this:
P1 (Home)
P2
P3
P4
P6 (Mount Point of P2, "Substitute Mount Point" checked)
P6 (Mount Point of P4)
P6 (Mount Point of P4, "Substitute Mount Point" checked)

- use the attached TS setup

This will render three JSMENUs with different depths and a conventional text menu (for comparison).
Best way to control the JSMENU URLs is to look into the HTML source of the generated page where you find the JS declarations of all menues with the URLs they link to.

WITHOUT the patch only those JSMENU items will link to the correct URL that do not contain a substitute MP anywhere in their rootline.

WITH the patch all JSMENU items on all levels link correctly (AKA identical to the links in the text menu).

Please make sure to use my revised patch as of today (also attached to this posting)!

Cheers,
Jörg

Actions #3

Updated by Benni Mack over 14 years ago

Commited to trunk (rev #17790)
Commited to TYPO3_4-3 (rev #17790)
Commited to TYPO3_4-2 (rev #17790)

Actions

Also available in: Atom PDF