Bug #86331

Mountpoints not working with new site configurations

Added by Alexander Grein over 1 year ago. Updated 4 days ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Start date:
2018-09-20
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

To reproduce:

Add two root pages with a site configuration for each.

Add a standard page with the name "page1" to site a.

Add a mountpoint page with the same name to site b.

Try to open page1 of site b in a browser: e.g. www.site-b.com/page1

Expected:
A page containing the same content as www.site-a.com/page1

Result:
A automatic redirect to a page with a url like www.site-*a*.com/page1?MP=3-20 showing an error:
PageNotFoundException: ID was outside the domain

The menu provider also generates wrong links to the site a with additional MP parameter.


Related issues

Related to TYPO3 Core - Bug #89039: MointPoints result in 404 if mounted page is outside the Site Resolved 2019-08-29
Related to TYPO3 Core - Bug #82521: Links to a mounted page in a page tree with a different domain are not prepended with the domain Closed 2017-09-20
Related to TYPO3 Core - Bug #90156: Avoid removing empty prefixes in mount-point handling Resolved 2020-01-20
Related to TYPO3 Core - Bug #90166: MountPoints with Site Handling crash if two sites have a page with the same slug Resolved 2020-01-21

Associated revisions

Revision 6170b24f (diff)
Added by Benni Mack 8 days ago

[FEATURE] Native MountPoint support for Site Handling

In order to link to mountpoints with Site Handling, the RootlineUtility
needs to receive the MountPoint parameter, to correctly
deal with mountpoint-related subpages.

Mount Points are based on the assumption that the "context" (the original
site environment) is kept. For this to work, the slug of the mount page (doktype=7)
is prefixed to the URL, but the common prefix of the subpages is trimmed
with the value of the mounted page (= pointer record).

The MP parameter is then added to PageArguments within the PageArguments
as "routeArgument" (= safe and clean argument) where TYPO3 is dealing
with this feature again in the same fashion it as before.

Various side-effects when dealing with mount points from other domains
still exist (= different language setup, or non-existing sites).

Feature Set:
  • Multi-language setup (= when language setup is the same) with slugs
  • Recursive mount points
  • No MP parameter available in URLs anymore (at all)
  • Multi-site setup (= when language setup is the same)

If a subpage of a mount page does not inherit the slug of the mounted page,
then the slug of the subpage is added in full afterwards.

Resolves: #86331
Resolves: #87473
Resolves: #89039
Releases: master, 9.5
Change-Id: I58f41eb325a07cc0c4a0dfeab1164eb8c58c7314
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Tested-by: Daniel Siepmann <>
Tested-by: Benni Mack <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Benni Mack <>

Revision 9fca335b (diff)
Added by Benni Mack 4 days ago

[FEATURE] Native MountPoint support for Site Handling

In order to link to mountpoints with Site Handling, the RootlineUtility
needs to receive the MountPoint parameter, to correctly
deal with mountpoint-related subpages.

Mount Points are based on the assumption that the "context" (the original
site environment) is kept. For this to work, the slug of the mount page (doktype=7)
is prefixed to the URL, but the common prefix of the subpages is trimmed
with the value of the mounted page (= pointer record).

The MP parameter is then added to PageArguments within the PageArguments
as "routeArgument" (= safe and clean argument) where TYPO3 is dealing
with this feature again in the same fashion it as before.

Various side-effects when dealing with mount points from other domains
still exist (= different language setup, or non-existing sites).

Feature Set:
  • Multi-language setup (= when language setup is the same) with slugs
  • Recursive mount points
  • No MP parameter available in URLs anymore (at all)
  • Multi-site setup (= when language setup is the same)

If a subpage of a mount page does not inherit the slug of the mounted page,
then the slug of the subpage is added in full afterwards.

Resolves: #86331
Resolves: #87473
Resolves: #89039
Releases: master, 9.5
Change-Id: I58f41eb325a07cc0c4a0dfeab1164eb8c58c7314
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933
Tested-by: TYPO3com <>
Tested-by: Marco Huber <>
Tested-by: Daniel Siepmann <>
Tested-by: Benni Mack <>
Reviewed-by: Marco Huber <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Benni Mack <>

Revision 03856efc (diff)
Added by Benni Mack 1 day ago

[BUGFIX] Allow MountPoints with the same slug and add tests

If a multi-site setup contains a page with slug "/products" as DOKTYPE=7
and "/products" in another site which is the Mounted Page the PageRouter
goes in an endless-loop as there is no context in the recursive call.

In addition, some other changes that have been adapted in the previous
9.5 backport are addressed now.

On top, there is now a MountPointScenario which serves as a basis for adding
more functionality in multi-lingual setups.

The next step is also to remove the redirect of the MountPoint page
with mount_pid_ol=1.

Resolves: #90166
Related: #86331
Releases: master, 9.5
Change-Id: If5c67ac813430f54737192341e22b58c9c275cf6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63007
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Tested-by: Susanne Moog <>
Tested-by: Benni Mack <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Alexander Grein over 1 year ago

I forgot to mention:
Put the mountpoint of "page1" of site b to "page1" of site a

#2 Updated by Georg Ringer over 1 year ago

  • Category set to Link Handling, Site Handling & Routing

#3 Updated by Sascha Wilking over 1 year ago

I can reproduce it. It doesn't matter what the page's name is. In my scenario i have the entry domain2.local/test1, where page "test1" is a mount point to another root (domain1.local) with page "test2". The menu link on domain2.local is also wrong and points to domain1.local/test2.

#4 Updated by Alexander Grein over 1 year ago

It looks like, that the whole MP handling is a known open point in typo3/sysext/core/Classes/Routing/PageUriBuilder.php (line 36):

  • @todo: check handling of MP parameter.

#5 Updated by Josef Glatz over 1 year ago

  • Priority changed from Should have to Must have

#6 Updated by Benni Mack over 1 year ago

  • Target version set to next-patchlevel

#7 Updated by Susanne Moog about 1 year ago

  • Sprint Focus set to On Location Sprint

#8 Updated by Nicolai Schirawski about 1 year ago

I will have a look onto the problem in typo3 sprint berlin

#9 Updated by Nicolai Schirawski about 1 year ago

Hier eine Dokumentation über das Verhalten der Mountpoints in TYPO3 9.5.1-dev:

Verhalten innerhalb einer Domain:
                                slug laut BE                Link auf diese Seite                    angezeigter Inhalt
-----------------------------------------------------------------------------------------------------------------
Rootseite           pid 1       slug: /                     link: domain1/
|__unter1           pid 2       slug: /unter1               link: domain1/unter1
   |__u11           pid 3       slug: /unter1/u11           link: domain1/unter1/u11                Inhalt: "u11" 
      |__u111       pid 4       slug: /unter1/u11/u111      link: domain1/unter1/u11/u111           Inhalt: "u111" 

----- Alternative1 :mount 1 mounted auf pid3; "show mounted page" 

|__mount1           pid 5       slug: /mount1               link: domain1/unter1/u11?MP=3-5         Inhalt: "u11" 
                                                            link: domain1/unter1/u11/u111?MP=3-5    Inhalt: "u111" 

----- Alternative2 :mount 1 mounted auf pid3; "show this page" 

|__mount1           pid 5       slug: /mount1               link: domain1/mount1                    Inhalt: "mount1" 
                                                            link: domain1/unter1/u11/u111?MP=3-5    Inhalt: "u111" 

Verhalten Domain-übergreifend:

                                slug laut BE                Link auf diese Seite                    angezeigter Inhalt
-----------------------------------------------------------------------------------------------------------------
Rootseite2          pid 6       slug: /                     link: domain2/
|__unter2           pid 7       slug: /unter2               link: domain2/unter2
   |__u21           pid 8       slug: /unter2/u21           link: domain2/unter2/u21                Inhalt: "u21" 
      |__u211       pid 9       slug: /unter2/u21/u211      link: domain2/unter2/u21/u211           Inhalt: "u211" 

----- Alternative1 :mount 2 mounted auf pid3; "show mounted page" 

|__mount2           pid 10      slug: /mount2               link: domain1/unter1/u11?MP=3-10        Inhalt: => Exception!!!
                                                   Soll:    link: domain2/unter1/u11?MP=3-10        Inhalt: "u11" 

                                                            link: domain1/unter1/u11/u111?MP=3-10   Inhalt: => Exception!!!
                                                   Soll:    link: domain2/unter1/u11/u111?MP=3-10   Inhalt: "u111" 

----- Alternative2 :mount 2 mounted auf pid3; "show this page" 

|__mount2           pid 10      slug: /mount2               link: domain2/mount2                    Inhalt: "mount2" 

                                                            link: domain1/unter1/u11/u111?MP=3-10   Inhalt: => Exception!!!
                                                   Soll:    link: domain2/unter1/u11/u111?MP=3-10   Inhalt: "u111" 

#10 Updated by Nicolai Schirawski about 1 year ago

I see major conceptional difficulties here. The question is: how do we want to deal with cross-domain-mounts?

The basic use case could be something like this: domain1 has a subtree, e.g. a blog, that should be shown on another page (domain2), too. On domain2 all mounted pages should have urls starting with "domain2".

By allowing that, we run into difficulties: we have to deal with internal links pointing out of the subtree onto other pages of domain1. The edge-case would be a sitemap being part of the subtree. Than the complete site domain1 would be visible under "domain2" as well.

This seems to be unwanted behaviour.

Possible solutions:
- we create a new page-property "allow shared" that allows a page and all of its subpages to be mounted on other domains as well. Internal links out of the shared pages must than either stay on the original domain or be disabled. Implementing that looks like a huge task.

- we just disallow cross-domain-mounts. The use-case "blog-subtree" could than be realised by creating a new subtree in domain2 and mapping all pages using "show content from page"

For the time beeing, I would suggest the second solution.

#11 Updated by Gerrit Code Review 11 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59915

#12 Updated by Gerrit Code Review 11 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59915

#13 Updated by Gerrit Code Review 11 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59915

#14 Updated by Gerrit Code Review 11 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59915

#15 Updated by Benni Mack 9 months ago

  • Target version changed from next-patchlevel to Candidate for patchlevel

#16 Updated by Christoph Kratz 8 months ago

$queryParameters['MP'] can have multiple comma-separated parameters, resulting in an endless redirect. The following exam works for me and fixes the problem.

typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php:188

if (!is_null($queryParameters['MP'])) {
  $mp = explode(",", $queryParameters['MP']);
  if (count($mp) > 1) {
    $queryParameters['MP'] = $mp[0];
  }
}
$siteOfTargetPage = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId((int)$page['uid'], null, $queryParameters['MP'] ?? '');

#17 Updated by Nikolas Hagelstein 3 months ago

Any news on that?

#18 Updated by Tizian Schmidlin 3 months ago

We ran into this issue lately too.

We will provide feedback on the current state of the patch asap.

#19 Updated by Stephan Boiting about 2 months ago

What is the status of the problem? We need the mountpointtrees in a multi-domain-channel asap for typo3 update

#20 Updated by Heiko Karner about 1 month ago

Is there anything new on this? Looks like it was set to "abandoned"... When will it be taken care of again? We need this for a current project so any Updates on this would be appreciated.

#21 Updated by Claus Fassing about 1 month ago

We had to cancel a current upgrade project cause of this and need a fix too

#22 Updated by Ingo Fabbri about 1 month ago

I really appreciate any work targeting PHP standards and replacing self-baked solutions with known and approved packages from e.g. symfony.

But mountpoints are there since TYPO3 v3 or even longer - at least they are there ever since I can remember using TYPO3.

v9 will be in security-only-mode within 4 months and it does not look like this issue will be fixed until then.

So this basically means, there is going to be a major TYPO3 LTS version with broken mountpoint-functionality.

And still uncertain if this will ever be fixed in v10 either.

just my 2c.

#23 Updated by Ralf Schlömer 18 days ago

Will there still be a working solution in TYPO3 9 LTS for the problems arising from the use of "mountpoints"?
Is there a tutorial somewhere for using mountpoints in TYPO3 9 LTS?

#24 Updated by Christoph Runkel 17 days ago

We also have a 40 Domain installation online with 84 Mountpoints incl. subpages.
So this is top urgent for us too.

I would also sponsor a short-term patch for that MP problem. Message me.

Christoph

#25 Updated by Susanne Moog 12 days ago

  • Sprint Focus deleted (On Location Sprint)

#26 Updated by Susanne Moog 12 days ago

  • Sprint Focus set to On Location Sprint

#27 Updated by Gerrit Code Review 10 days ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#28 Updated by Benni Mack 9 days ago

  • Related to Bug #89039: MointPoints result in 404 if mounted page is outside the Site added

#29 Updated by Gerrit Code Review 9 days ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#30 Updated by Stephan Boiting 9 days ago

Hi, is this patch really for TYPO3 Version 9?
Error: Class 'TYPO3\CMS\Core\Domain\Repository\PageRepository' not found

#31 Updated by Gerrit Code Review 9 days ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#32 Updated by Benni Mack 9 days ago

  • Related to Bug #82521: Links to a mounted page in a page tree with a different domain are not prepended with the domain added

#33 Updated by Gerrit Code Review 9 days ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#34 Updated by Gerrit Code Review 9 days ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#35 Updated by Gerrit Code Review 9 days ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#36 Updated by Gerrit Code Review 8 days ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#37 Updated by Gerrit Code Review 8 days ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#38 Updated by Gerrit Code Review 8 days ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62878

#39 Updated by Benni Mack 8 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#40 Updated by Gerrit Code Review 8 days ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

#41 Updated by Gerrit Code Review 8 days ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

#42 Updated by Gerrit Code Review 8 days ago

Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

#43 Updated by Benni Mack 8 days ago

Please see the 9.5 backport https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

In v10 it's included finally!

#44 Updated by Gerrit Code Review 8 days ago

Patch set 4 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

#45 Updated by Gerrit Code Review 8 days ago

Patch set 5 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

#46 Updated by Gerrit Code Review 8 days ago

Patch set 6 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

#47 Updated by Gerrit Code Review 8 days ago

Patch set 7 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62933

#48 Updated by Benni Mack 4 days ago

  • Status changed from Under Review to Resolved

#49 Updated by Oliver Hader 4 days ago

  • Related to Bug #90156: Avoid removing empty prefixes in mount-point handling added

#50 Updated by Benni Mack 3 days ago

  • Related to Bug #90166: MountPoints with Site Handling crash if two sites have a page with the same slug added

Also available in: Atom PDF