Bug #83097
closedRenderViewhelper generates wrong urls
0%
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
Updated by Wouter Wolters almost 7 years ago
- Assignee deleted (
Björn Jacob)
Please do not assign issue to anyone. Thanks.
Updated by Ralf Zimmermann almost 7 years ago
Updated by Sebastian Fischer almost 7 years ago
- File footercontactform.yaml footercontactform.yaml added
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);
}
}
Updated by Ralf Zimmermann over 6 years ago
Please read: https://docs.typo3.org/typo3cms/extensions/form/latest/Concepts/FrontendRendering/Index.html#render-through-fluidtemplate-without-controller
i'm pretty sure you forgot
10 = FLUIDTEMPLATE 10 { # ... extbase.pluginName = Form extbase.controllerExtensionName = Formframework extbase.controllerName = FormFrontend extbase.controllerActionName = perform }
Updated by Ralf Zimmermann over 6 years ago
- Status changed from New to Needs Feedback
- Assignee set to Sebastian Fischer
Updated by Ralf Zimmermann over 6 years ago
- 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!