Skip to content

"sys_page" is not set (is the defined string) in TypoScriptFrontendController and makes an error in the PageLinkBuilder #128

Description

@dhuf

We had the error in vendor/typo3/cms-frontend/Classes/Typolink/PageLinkBuilder.php line 303:

Call to a member function getMountPointInfo() on string

the $this->sys_page was not set.

To fix it we had to define it in the vendor/sitegeist/fluid-styleguide/Classes/Middleware/StyleguideRouter.php from line 96:

        // Build simple TSFE object for basic typolink support in styleguide
        $tsfe = GeneralUtility::makeInstance(
            TypoScriptFrontendController::class,
            $this->context,
            $GLOBALS['TYPO3_CURRENT_SITE'],
            $request->getAttribute('language', $site->getDefaultLanguage()),
            new PageArguments(0, '0', []),
            $this->frontendUserAuthentication
        );
        $tsfe->sys_page = GeneralUtility::makeInstance(PageRepository::class, $this->context);
        $GLOBALS['TSFE'] = $tsfe;

The fix was to init it:

$tsfe->sys_page = GeneralUtility::makeInstance(PageRepository::class, $this->context);

Maybe it might help somebody else.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions