Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: TSFE->cObj not available on shortcut pages #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christophlehmann
Copy link

This fixes the TypeError

JWeiland\Replacer\Helper\TypoScriptHelper::getContentObjectRenderer(): Return value must be of type TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer, null returned

that occurs, when you visit a shortcut page with its original slug.

Resolves: #2

This fixes the TypeError

JWeiland\Replacer\Helper\TypoScriptHelper::getContentObjectRenderer(): Return value must be of type TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer, null returned

that occurs, when you visit a shortcut page with its original slug.

Resolves: jweiland-net#2
if (!$this->getTypoScriptFrontendController()->isINTincScript() || $response instanceof NullResponse) {
if (!$this->getTypoScriptFrontendController()->isINTincScript()
|| $response instanceof NullResponse
|| $this->getContentObjectRenderer() === null
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively we could check isset($this->getTypoScriptFrontendController()->page['_SHORTCUT_ORIGINAL_PAGE_UID'])

Copy link

@Atomschinken Atomschinken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in v11

@Atomschinken
Copy link

As this PR is solving an error preventing us from updating to the latest version i would love to see it being merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants