Project

General

Profile

Actions

Bug #91285

open

PageRouter takes always first possible MPvar

Added by Steffen Hastädt over 4 years ago. Updated about 2 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2020-05-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

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
        )

Actions #1

Updated by Steffen Hastädt over 4 years ago

  • Description updated (diff)
Actions #2

Updated by Steffen Hastädt over 4 years ago

  • File deleted (Screenshot2020-05-03-21.17.12.png)
Actions #3

Updated by Steffen Hastädt over 4 years ago

  • Description updated (diff)
Actions #4

Updated by Steffen Hastädt over 4 years ago

  • Description updated (diff)
Actions #5

Updated by Steffen Hastädt over 4 years ago

  • Description updated (diff)
Actions #6

Updated by Steffen Hastädt over 4 years ago

  • Description updated (diff)
Actions #7

Updated by Steffen Hastädt over 4 years ago

  • Subject changed from routeEnhancers takes always first possible MPvar to PageRouter takes always first possible MPvar
Actions #8

Updated by Steffen Hastädt over 4 years ago

  • Description updated (diff)
Actions #9

Updated by Steffen Hastädt over 4 years ago

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
        )

Actions #10

Updated by Benni Mack over 4 years ago

  • Is Regression set to Yes
Actions #11

Updated by Steffen Hastädt over 4 years ago

  • Description updated (diff)
Actions #12

Updated by Benni Mack about 2 years ago

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.

Actions #13

Updated by Benni Mack about 2 years ago

  • Status changed from New to Accepted
Actions

Also available in: Atom PDF