Issue Bug Closed

#101624PHP Warning: Undefined array key "MPvar" in typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php line 399

Philipp Parzer 08/09/23, 07:20 updated 12/02/25, 14:37

Description

Error occurs if you have a mount point, which points to a page and this page has a subpage which has a content_from_pid set

- Home
  - A
    - aa
    - ab (show content from aa)
  - B (mount point to A)

if you now call /B/ab you get the error

could be easily solved:

(string)($pageCandidate['MPvar'] ?? $pageCandidate['mount_pid_ol']),

Reviews 2

History 916

  1. Simon Schaufelberger changed subject PHP Warning: Undefined array key "MPvar" in /website/public/typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php line 399 PHP Warning: Undefined array key "MPvar" in typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php line 399 description <span data-processor="relativetime" data-value="2023-09-22T08:35:49+00:00" > 09/22/23, 08:35 </span>

  2. Thomas Hohn commented <span data-processor="relativetime" data-value="2023-10-10T04:42:26+00:00" > 10/10/23, 04:42 </span>

    Philipp Parzer wrote:
    > Error occurs if you have a mount point, which points to a page and this page has a subpage which has a content_from_pid set
    >
    > […]
    >
    > if you now call /B/ab you get the error
    >
    > could be easily solved:
    >
    > (string)($pageCandidate['MPvar'] ?? $pageCandidate['mount_pid_ol']),

    Philipp Parzer wrote:
    > Error occurs if you have a mount point, which points to a page and this page has a subpage which has a content_from_pid set
    >
    > […]
    >
    > if you now call /B/ab you get the error
    >
    > could be easily solved:
    >
    > (string)($pageCandidate['MPvar'] ?? $pageCandidate['mount_pid_ol']),

    Could you please verify the proposed patch @siwa_pparzer ?

  3. Georg Ringer commented <span data-processor="relativetime" data-value="2024-05-28T21:24:33+00:00" > 05/28/24, 21:24 </span>

    @Philipp there was a question to reproduce in gerrit.

    I can reproduce it by setting at one of the pages (A, ab) in the example above

    - Home
      - A
        - aa
        - ab (show content from aa)
      - B (mount point to A)

    the field mount_pid_ol to 1. this can be achieved by switching it to type mount point, set the field and set it back to regular page or just use the DB

  4. Anonymous commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-01-31T13:15:08+00:00" > 01/31/25, 13:15 </span>

    Applied in changeset commit:df3e5193f714fa2567cf76097691057a0e9ea90d.