Bug #83097
closed
RenderViewhelper generates wrong urls
Added by Sebastian Fischer almost 7 years ago.
Updated over 6 years ago.
Description
I'm using the renderViewhelper in a fluid page template. The result is an url like this:
/index.html?tx__%5Baction%5D=perform&tx__%5Bcontroller%5D=Standard&cHash=178ef185135feb549ddc9d693f11b2d6#footercontactform
The extension and pluign are missing and action and controller values are are completly off.
This gets even worth if you have another extbase plugin on the page that gets rendered before the form. Then the url is like:
/index.html?tx_solr%5Baction%5D=perform&tx_solr%5Bcontroller%5D=Standard&cHash=931c486b6990dbbc51f464ad7ba7173b#footercontactform
Files
- Assignee deleted (
Björn Jacob)
Please do not assign issue to anyone. Thanks.
That's what i did:
<formvh:render persistenceIdentifier="{footerContactForm}" />
Form yaml is attached. Still i get a malformed url with solr parameter instead of the expected.
I added in an extension of the viewhelper the following method which needs to be called on top of the renderStatic.
/**
* @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext $renderingContext
*/
protected static function addExtensionInformation(&$renderingContext)
{
$extensionName = 'form';
$pluginName = 'formframework';
$controller = 'FormFrontend';
$action = 'perform';
$renderingContext->setControllerName($controller);
$renderingContext->setControllerAction($action);
/** @var Request $request */
$request =& $renderingContext->getControllerContext()->getRequest();
$request->setControllerExtensionName($extensionName);
$request->setPluginName($pluginName);
/** @var \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService */
$extensionService = $renderingContext->getObjectManager()
->get(\TYPO3\CMS\Extbase\Service\ExtensionService::class);
$pluginNamespace = $extensionService->getPluginNamespace($extensionName, $pluginName);
/** @var \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService */
$environmentService = $renderingContext->getObjectManager()
->get(\TYPO3\CMS\Extbase\Service\EnvironmentService::class);
$request->setMethod($environmentService->getServerRequestMethod());
$parameters = \TYPO3\CMS\Core\Utility\GeneralUtility::_GPmerged($pluginNamespace);
foreach ($parameters as $argumentName => $argumentValue) {
$request->setArgument($argumentName, $argumentValue);
}
}
- Status changed from New to Needs Feedback
- Assignee set to Sebastian Fischer
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Sebastian Fischer)
No Feedback since nearly 3 months. I am closing this issue. If the problem still exists please re-open this issue or create a new one. Thx mate!
Also available in: Atom
PDF