Embed custom ext:form in Fluid layout file

842 Views Asked by At

I have a custom "Contact Us" form that sits within my Sitepackage - using TYPO3 v10.

The form works fine and I'm able to insert the form on any page the same way you'd insert any other form/content element.

What I'd like to do is have the form present on every page by adding it to my global layout template, so that it sits in the footer.

From the docs, I added this to my Fluid layout template:

<formvh:render persistenceIdentifier="EXT:my_site_package/Resources/Private/Forms/my_contact_us.form.yaml"/>

And I added this to my form conf (my_contact_us.form.yaml):

    renderingOptions:
      controllerAction: perform
      addQueryString: false
      argumentsToBeExcludedFromQueryString: [ ]
      additionalParams: [ ]

When I do this, I get a type error:

Argument 1 passed to TYPO3\CMS\Extbase\Service\ExtensionService::getPluginNameByAction() must be of the type string, null given

Is there something I haven't configured correctly? Any help is appreciated, thanks again.

1

There are 1 best solutions below

0
Mati On

I also experienced that some time ago and just a couple of hours ago..

Fixed it - for now within a workaround - by overwriting the lines between 235-241 where the \TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper sets as default null values for action, controller, extensionName and pluginName.

Replacing that with this:

$formActionUri = $uriBuilder->uriFor(
    $this->arguments['action'] ?? 'render',
    $this->arguments['arguments'] ?? [],
    $this->arguments['controller'] ?? 'FormFrontendController',
    $this->arguments['extensionName'] ?? 'form',
    $this->arguments['pluginName'] ?? 'Formframework'
);

Works fine for myself right now. Tested on TYPO3 v10.4.13