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

AbstractLinkViewHelper returns wrong RequestInterface #815

Open
rteitge opened this issue Sep 28, 2024 · 1 comment
Open

AbstractLinkViewHelper returns wrong RequestInterface #815

rteitge opened this issue Sep 28, 2024 · 1 comment

Comments

@rteitge
Copy link

rteitge commented Sep 28, 2024

I'm using the IndexViewHelper in FE with T3 v12.4.20 to generate a link with the index record and detailPid. It throws this error:

HDNET\Calendarize\ViewHelpers\Link\AbstractLinkViewHelper::getRequest(): Return value must be of type TYPO3\CMS\Extbase\Mvc\RequestInterface, TYPO3\CMS\Core\Http\ServerRequest returned

AbstractLinkViewHelper::getRequest() currently returns an TYPO3\CMS\Extbase\Mvc\RequestInterface, but RenderingContext::getRequest() returns an Psr\Http\Message\ServerRequestInterface, which extends Psr\Http\Message\RequestInterface.

My code:
<h3><cl:Index index="{record.index}" pageUid="{detailPid}" class="url">{record.event.title}</cl:Index></h3>

@rteitge
Copy link
Author

rteitge commented Sep 28, 2024

The next problem: UriBuilder::setRequest($request) indeed takes the TYPO3\CMS\Extbase\Mvc\RequestInterface, but doesn't meet the RequestInterface provided by RenderingContext::getRequest(), so if you change the return type of AbstractLinkViewHelper::getRequest() it crashes here.

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

No branches or pull requests

1 participant