Bug #87473

Type error in PageLinkBuilder.php

Added by Robert von Hackwitz 6 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2019-01-18
Due date:
% Done:

100%

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

Description

Argument 2 passed to TYPO3\CMS\Frontend\Typolink\PageLinkBuilder::populateMountPointMapForPageRecursively() must be of the type integer, string given, called in typo3_src-9.5.3/typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php on line 612
but actually method initializeMountPointMap can pass a string.

Method populateMountPointMapForPageRecursively:

 protected function populateMountPointMapForPageRecursively(array &$mountPointMap, int $id, $MP_array = [], $level = 0)
    {
        if ($id <= 0) {
            return;
        }
        // First level, check id
        if (!$level) {
            // Find mount point if any:
            $mount_info = $this->getTypoScriptFrontendController()->sys_page->getMountPointInfo($id);

Call inside method initializeMountPointMap:
$rootPoints = GeneralUtility::trimExplode(',', strtolower($mapRootPointList), true);
        // Traverse rootpoints
        foreach ($rootPoints as $p) {
            $initMParray = [];
            if ($p === 'root') {
                $rootPage = $this->getTypoScriptFrontendController()->tmpl->rootLine[0];
                $p = $rootPage['uid'];
                if ($p['_MOUNT_OL'] && $p['_MP_PARAM']) {
                    $initMParray[] = $p['_MP_PARAM'];
                }
            }
            $this->populateMountPointMapForPageRecursively($mountPointMap, $p, $initMParray);
        }
        $runtimeCache->set('pageLinkBuilderMountPointMap', $mountPointMap);
        return $mountPointMap;

Associated revisions

Revision 0a323544 (diff)
Added by Benni Mack 4 months ago

[BUGFIX] Fix strict type error in recursive mount point resolving

PageLinkBuilder::populateMountPointMapForPageRecursively() requires
the $id parameter to be an integer, so this is cast properly now.

In addition, one regression is fixed where
"config.MP_mapRootPoints = root" was set, the proper variables
are now used.

Resolves: #87547
Resolves: #87473
Releases: master, 9.5
Change-Id: I899120d301309d768b9e498ad7f4ec96b9618b9d
Reviewed-on: https://review.typo3.org/c/59916
Tested-by: Markus Klein <>
Tested-by: TYPO3com <>
Tested-by: Georg Ringer <>
Reviewed-by: Markus Klein <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Georg Ringer <>

Revision ea7c4b47 (diff)
Added by Benni Mack 4 months ago

[BUGFIX] Fix strict type error in recursive mount point resolving

PageLinkBuilder::populateMountPointMapForPageRecursively() requires
the $id parameter to be an integer, so this is cast properly now.

In addition, one regression is fixed where
"config.MP_mapRootPoints = root" was set, the proper variables
are now used.

Resolves: #87547
Resolves: #87473
Releases: master, 9.5
Change-Id: I899120d301309d768b9e498ad7f4ec96b9618b9d
Reviewed-on: https://review.typo3.org/c/59923
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Robert von Hackwitz 6 months ago

  • Category set to Frontend

#2 Updated by Robert von Hackwitz 6 months ago

  • Priority changed from Must have to Should have
  • Target version set to Candidate for patchlevel

#3 Updated by Robert von Hackwitz 6 months ago

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

#4 Updated by Gerrit Code Review 4 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/+/59916

#5 Updated by Gerrit Code Review 4 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/+/59916

#6 Updated by Gerrit Code Review 4 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/+/59916

#7 Updated by Gerrit Code Review 4 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

#8 Updated by Gerrit Code Review 4 months ago

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/+/59923

#9 Updated by Benni Mack 4 months ago

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

#10 Updated by Benni Mack 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF