Why RequiredArgumentMissingException? TYPO3

38 views Asked by At

I have 2 Forms i will send first the Prototype that worked:

<f:form action="rate" controller="GameRate" arguments="{gameRate: gameRate}">
   <f:form.select name="rating" options="{1: '1', 2: '2', 3: '3', 4: '4', 5: '5'}" />
   <f:form.submit value="Bewerten" />
</f:form>

but why does that first From work but that form does not:

<f:form action="rate" controller="GameRate" arguments="{gameRate: gameRate}">
    <input type="radio" id="stern5" name="rating" value=5><label for="stern5"></label>
    <input type="radio" id="stern4" name="rating" value=4><label for="stern4"></label>
    <input type="radio" id="stern3" name="rating" value=3><label for="stern3"></label>
    <input type="radio" id="stern2" name="rating" value=2><label for="stern2"></label>
    <input type="radio" id="stern1" name="rating" value=1><label for="stern1"></label>
    <f:form.submit value="Bewerten" />
</f:form>

The error Message i get from the Second Form:

(1/1) #1298012500 TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException
Required argument "rating" is not set for Bennet\Grkey\Controller\GameRateController->rate.

Why would rating not be send with it?

1

There are 1 answers

0
Garvin Hicking On

You must pay attention to use f:form viewhelpers to propagate forms in extbase properly. A "native" HTML input field does not contain the proper extbase connections and fieldnames.

So, you need to use https://docs.typo3.org/other/typo3/view-helper-reference/12.4/en-us/typo3/fluid/latest/Form/Radio.html instead of raw elements.

You can compare the HTML output to see the difference, also in the extbase hidden inputs near the opening form.