How to use ext:form in own extbase/fluid extension?

Hello,

we have to integrate Typo3 from framework forms into our own detail view of an extbase-extension. (typical overview- and detail-view of news records).

Therefore our news record got an additional TCA colum with an file reference to the YAML of the form definition and we followed the official documentation to render the form: Frontend rendering — Form main documentation

<formvh:render persistenceIdentifier="{content.includeFormframework.originalResource.originalFile.publicUrl}" />

Following this tutorial TYPO3 Use Form Framework forms in your own extensions · sitegeist , we added an “submitformAction” to the controller of our own extension, which then redirects back to the “showAction”:

public function submitformAction(\MyNamespace\MyExt\Domain\Model\Topic $topic) : ResponseInterface {
	return (new ForwardResponse('show'))->withArguments(['topic' => $topic]);
}

Setting this action in the template:

<formvh:render
	persistenceIdentifier="{content.includeFormframework.originalResource.originalFile.publicUrl}"
	overrideConfiguration="{
		renderingOptions: {
			controllerAction: 'submitform',
			additionalParams: {
				'tx_myext_pi1[topic]': 123
			}
		}    
	}"
/>

The action is called and we are redirected to the detail-view, but none of the form validators or finishers are called. You will simply again see the form, but now with the values you entered before.

So what have we to do to get the finishers running? Is there a special code we have to add to the submitformAction() ?

The question is similar to:

https://stackoverflow.com/questions/74102755/form-framework-in-news-detail-view
I dont think that is the problem here. I can define the controller action and the handling of querystring directly in the yaml of the form. No need for the overrideConfiguration. The problem is: when i use detailAction the news is shown and the form not processed. If i use perform i get an exception because news dont have this controller. I dont think that it is possible to implement form in an extension as it is described in the manual. There has to be something missing …

Thanks!

Hi @webadmin!

It doesn’t look like anyone has the solution, but I would recommend that you try to step debug the process with XDebug. It should give you information about what happens — and what doesn’t — and when.