Project

General

Profile

Actions

Bug #83097

closed

RenderViewhelper generates wrong urls

Added by Sebastian Fischer over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2017-11-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

footercontactform.yaml (2.15 KB) footercontactform.yaml Sebastian Fischer, 2017-11-28 08:37
Actions #1

Updated by Wouter Wolters over 6 years ago

  • Assignee deleted (Björn Jacob)

Please do not assign issue to anyone. Thanks.

Actions #3

Updated by Sebastian Fischer over 6 years ago

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);
        }
    }

Actions #4

Updated by Ralf Zimmermann about 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
}
Actions #5

Updated by Ralf Zimmermann about 6 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Sebastian Fischer
Actions #6

Updated by Ralf Zimmermann almost 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!

Actions

Also available in: Atom PDF