Issue Bug Closed

#91285PageRouter takes always first possible MPvar

Steffen Hastädt 05/03/20, 21:56 updated 11/06/26, 10:24

Description

If a multi-domain installation has the same page mounted to different domains, only one page will be able to display the mounted page tree.

I have the following setup (Page UID – type – slug):

Root
    [11] - Domain.at - "/"
            [12] - MP - "/glass"
    [31] - Domain.hr - "/"
            [32] - MP - "/glass"
    [16] - Domain.cz - "/"
            [17] - MP - "/glass"
    [36] - Domain.it - "/"
            [37] - MP - "/glass"
    [21] - Domain.sk - "/"
            [22] - MP - "/glass"
    [6] - Domain.ch - "/"
            [7] - Page - "/glass"
                    [814] - MP - "/glass/properties"
    [26] - Domain.ua - "/"
            [27] - MP - "/glass"
    [1] - Domain.ch - "/"
            [2] - Page - "/glass"
                    [242] - Page - "/glass/properties"
  • Domain.com has the page tree without MountPoints
  • Domain.ch has the page mounted with “show page of mounted page”
  • The rest of the domains has the Mount Point one level up and mounts the whole page tree under “glass”

I always call the same URL. on each Domain “/en/glass/properties”

https://www.domain.at/en/glass/properties – OK
https://www.domain.hr/en/glass/properties – “ID was outside the domain”
https://www.domain.cz/en/glass/properties – “ID was outside the domain”
https://www.domain.it/en/glass/properties – “ID was outside the domain”
https://www.domain.sk/en/glass/properties – “ID was outside the domain”
https://www.domain.ch/en/glass/properties – “ID was outside the domain”
https://www.domain.ua/en/glass/properties – “ID was outside the domain”
https://www.domain.com/en/glass/properties – OK

The result of getPagesFromDatabaseForCandidates looks always the but with the correct root page UID.

Result for AT:

    [0] => Array
        (
            [uid] => 2
            [pid] => 1
            ...
            [doktype] => 1
            ...
            [mount_pid] => 0
            [mount_pid_ol] => 0
            ...
            [slug] => /glass
            ...
            [MPvar] => 2-12
        )

    [1] => Array
        (
            [uid] => 242
            [l10n_parent] => 0
            [pid] => 2
            [slug] => /glass/properties
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
            [MPvar] => 2-12
        )

    [2] => Array
        (
            [uid] => 11
            [l10n_parent] => 0
            [pid] => 0
            [slug] => /
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
        )

Exact same result for HR, CZ, IT, SK. Only the UID of the root page is different:

    [0] => Array
        (
            [uid] => 2
            [pid] => 1
            ...
            [doktype] => 1
            ...
            [mount_pid] => 0
            [mount_pid_ol] => 0
            ...
            [slug] => /glass
            ...
            [MPvar] => 2-12
        )

    [1] => Array
        (
            [uid] => 242
            [l10n_parent] => 0
            [pid] => 2
            [slug] => /glass/properties
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
            [MPvar] => 2-12
        )

    [2] => Array
        (
            [uid] => 31
            [l10n_parent] => 0
            [pid] => 0
            [slug] => /
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
        )

Since the first mount point fills up the MPvar and the MountPage record in the array during the first run, all the other pages are skipped in line 441++

                if ($mountedPage && PageRepository::DOKTYPE_MOUNTPOINT === (int)$row['doktype'] && $row['mount_pid_ol']) {
                    // If the mounted page was already added from above, this should not be added again (to include
                    // the mount point parameter).
                    if (in_array((int)$mountedPage['uid'], $excludeUids, true)) {
                        continue;
                    }

And I think this is causing the “ID was outside the domain” error.

As addition the result of the Domain.com main page:

    [0] => Array
        (
            [uid] => 242
            [l10n_parent] => 0
            [pid] => 2
            [slug] => /glass/properties
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
        )

    [1] => Array
        (
            [uid] => 2
            [l10n_parent] => 0
            [pid] => 1
            [slug] => /glass
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
        )

    [2] => Array
        (
            [uid] => 1
            [l10n_parent] => 0
            [pid] => 0
            [slug] => /
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
        )

And the result of the site with the mounted page:

    [0] => Array
        (
            [uid] => 7
            [l10n_parent] => 0
            [pid] => 6
            [slug] => /glass
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
        )

    [1] => Array
        (
            [uid] => 2
            [pid] => 1
            ...
            [title] => Glass
            [doktype] => 1
            ...
            [mount_pid] => 0
            [mount_pid_ol] => 0
            ...
            [slug] => /glass
            ...
            [MPvar] => 2-12
        )

    [2] => Array
        (
            [uid] => 242
            [l10n_parent] => 0
            [pid] => 2
            [slug] => /glass/properties
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
            [MPvar] => 2-12
        )

    [3] => Array
        (
            [uid] => 6
            [l10n_parent] => 0
            [pid] => 42
            [slug] => /
            [mount_pid] => 0
            [mount_pid_ol] => 0
            [t3ver_state] => 0
            [doktype] => 1
        )

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 14

  1. Steffen Hastädt changed subject routeEnhancers takes always first possible MPvar PageRouter takes always first possible MPvar <span data-processor="relativetime" data-value="2020-05-03T22:41:16+00:00" > 05/03/20, 22:41 </span>

  2. Steffen Hastädt commented <span data-processor="relativetime" data-value="2020-05-03T22:51:18+00:00" > 05/03/20, 22:51 </span>

    I think the MPvar and the MountPoint page itself are wrong as the result of this method:

          [MPvar] => 2-12

    and

        [1] => Array
            (
                [uid] => 242
                [l10n_parent] => 0
                [pid] => 2
                [slug] => /glass/properties
                [mount_pid] => 0
                [mount_pid_ol] => 0
                [t3ver_state] => 0
                [doktype] => 1
                [MPvar] => 2-12
            )
  3. Benni Mack commented <span data-processor="relativetime" data-value="2022-11-11T16:16:05+00:00" > 11/11/22, 16:16 </span>

    Yes. I understood your ticket.

    The main problem is that when going through all possible pages with the same slug, the Mounted Page is already “used” or “re-used” within the getPagesFromDatabaseForCandidates, however we should distinguish them on a per-site level.

    If MPvar within this class needs to be stored on a per-site basis, not on a global basis.

  4. Benni Mack commented and changed status Accepted Closed <span data-processor="relativetime" data-value="2026-11-06T10:24:39+00:00" > 11/06/26, 10:24 </span>

    Cannot reproduce this on current main anymore. The scenario from the description (same page mounted by several sites with identical slugs, with and without “show content of mounted page”, plus a site mounting only the subpage) resolves /en/glass/properties correctly on every site with the site-specific MP parameter. Mount points of other sites with the same slug are skipped since #90469 (Allow multiple mountpoints with the same slug). Closing — please reopen with a reproducible setup if it still occurs on 13.4/14.x.