Bug #17537
closedShortcuts within mounted trees lose MP-Parameter
0%
Description
When mounting a tree which has shortcut pages in it, a link to such a shortcut page has the MP-parameter in it. But when redirecting to the destination page of the shortcut, the MP-parameter seems to get lost.
(So e.g. if the original tree and the mounted tree use different stylesheets, you jump from one style to the other.)
(issue imported from #M6161)
Files
Updated by Popy no-lastname-given about 14 years ago
There is 2 reasons of this (kind of) bug :
First is that tslib_fe->getPageAndRootline method "clean" the MP var if ANY shortcut is found in the rootline (which is definitively wrong, according to the comment :
// We need to clear MP if the page is a shortcut. Reason is IF the short cut goes to another page, then we LEAVE the rootline which the MP expects.
So, as explained by the comment, IF the short cut DOES NOT go to another page, we have a weird behaviour. That's why (based on my comprehension of the mechanics) it should be tslib_fe->getPageShortcut responsability to clear OR NOT the MP var (only if needed).
Second reason is that tslib_fe->getPageShortcut fails himself while resolving shortcut with a "shortcut mode". The function t3lib_pageselect->getMenu is used to get shortcut subpages. This function store MP information in a "virtual" field "_MP_PARAM" in the results, and this information IS NOT USED !
My first patch resolves this 2 problems (the second patch is EXACTLY the same but I HAD TO REMOVE the "while list = each"), assuming the MPvar order is not wrong (in my code) or not important (for the core)
Updated by Julien Bourdin over 13 years ago
The issue is still present in 4.4.
Popy patch is quite OK for the 2 special shortcut modes (first page & random), he let the actual shortcut to clear the MP context.
It would be better to improve the shortcut mode with a test : should the source and the target of the shortcut be in the same rootline, the MP params need to be preserved (IMHO).
Updated by Andreas Wolf over 12 years ago
- File 17537-v3.diff 17537-v3.diff added
- Status changed from New to Accepted
- Target version deleted (
0)
Still present in at least 4.5 and 4.6, I presume also in 4.7/master.
Attached patch is a reworked and extended version of Popy's original patch, taking into account the new shortcut mode "parent page".
Updated by Andreas Wolf over 12 years ago
The problem is hidden in menus in TYPO3 >= 4.6, because of #32938, but still exists under the hood (= if you call a shortcut directly).
Updated by Gerrit Code Review over 12 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/10091
Updated by Gerrit Code Review over 12 years ago
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10100
Updated by Gerrit Code Review over 12 years ago
Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/10101
Updated by Gerrit Code Review over 12 years ago
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/10102
Updated by Stephan Vidar over 11 years ago
Patch 17537-v3.diff solves the problems in TYPO3 4.5.25 but in our case only shortcuts of mode "first subpage of current page". If shortcut-mode is "selected page" the mp-parameters will be lost... But we need this behavior even in shortcuts of mode "selected page" and the following lines fix the problem in our case:
function getPageShortcut($SC,$mode,$thisUid,$itera=20,$pageLog=array()) {
...
switch($mode) {
...
default:
//$this->MP = '';
...
break;
...
}
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Gerrit Code Review over 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Gerrit Code Review over 11 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Andreas Wolf over 11 years ago
Stephan Vidar wrote:
Patch 17537-v3.diff solves the problems in TYPO3 4.5.25 but in our case only shortcuts of mode "first subpage of current page". If shortcut-mode is "selected page" the mp-parameters will be lost... But we need this behavior even in shortcuts of mode "selected page" and the following lines fix the problem in our case:
function getPageShortcut($SC,$mode,$thisUid,$itera=20,$pageLog=array()) {
...
switch($mode) {
...
default:
//$this->MP = '';
...
break;
...
}
The problem is that shortcuts to pages outside the mountpoint will fail again with your solution. We have to differentiate between two different cases: The shortcut target is either (a) within or (b) not within the mounted subtree where the shortcut resides.
Ideally, this should be respected when generating the menu links, though it will still work if it is only done when resolving the shortcut.
Updated by Gerrit Code Review about 11 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Gerrit Code Review about 11 years ago
Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Gerrit Code Review almost 10 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/10100
Updated by Gerrit Code Review almost 10 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/10100
Updated by Gerrit Code Review over 8 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Gerrit Code Review over 8 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/10100
Updated by Mathias Schreiber almost 8 years ago
- Status changed from Under Review to Accepted
- Is Regression set to No
Updated by Tymoteusz Motylewski about 7 years ago
- Related to Bug #81251: Upon redirect of an overlaid mount point the mount point parameters get lost added
Updated by Susanne Moog about 7 years ago
- Category set to Site Handling, Site Sets & Routing
Updated by Christian Kuhn about 6 years ago
- Status changed from Accepted to New
Updated by Susanne Moog about 6 years ago
- Sprint Focus set to On Location Sprint
Updated by Nicolai Schirawski about 6 years ago
In TYPO3 9.5.1-dev, the issue is solved:
Links to external urls in mounted subtrees don't keep the MP-Parameter.
In shortcuts the MP-Parameter ist kept.
Updated by Nicolai Schirawski about 6 years ago
in TYPO3 8.7.20-dev the issue is solved, too.
Same behaviour like in 9.5
Updated by Anja Leichsenring about 6 years ago
- Status changed from New to Resolved