Project

General

Profile

Actions

Bug #87473

closed

Type error in PageLinkBuilder.php

Added by Robert von Hackwitz over 5 years ago. Updated about 4 years ago.

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

100%

Estimated time:
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;

Actions

Also available in: Atom PDF