[TYPO3-mvc] Nested objects in edit form not updated

Stefan Thuis stefan.thuis at gmx.de
Sat Jan 21 09:42:48 CET 2017


I have created an extension in Typo3 7.6 with extension builder with nested objects. I want to edit different model objects in one edit form. All objects are properly connected by relations.

The relevant structure looks like this:

ligagruppe->1:n (ligagruppespieltag)->spieltag->1:n(spieltageinzelergebnisse)->einzelergebnisse

The relevant part of my fluid template looks like this:

<f:form action="update" name="ligagruppe" object="{ligagruppe}" >
<f:for each="{ligagruppe.ligagruppespieltag}" as="spieltage">
    <label>Spielort</label>
    <f:form.textfield name="ligagruppe[ligagruppespieltag][{spieltage.uid}][spielort]" value="{spieltage.spielort}" />
    <f:form.hidden name="ligagruppe[ligagruppespieltag][{spieltage.uid}][__identity]" value="{spieltage.uid}" /><br />
    <f:for each="{spieltage.spieltageinzelergebnisse}" as="res">
        <label>Spiel 1</label>
        <f:form.textfield name="spieltage[spieltageinzelergebnisse][{res.uid}][spiel1]" value="{res.spiel1}" />
        <f:form.hidden name="spieltage[spieltageinzelergebnisse][{res.uid}][__identity]" value="{res.uid}" /><br />
    </f:for>
</f:for>    
<f:form.submit value="Save" />
</f:form>

When I call the edit form existing values are properly displayed. I can update everything on the first level (ligagruppe) and second level (spieltag) but the update on the third level (einzelergebnisse) doesn't work.

I have tried various combinations for

<f:form.textfield name="spieltage[spieltageinzelergebnisse][{res.uid}][spiel1]" 

and

<f:form.hidden name="spieltage[spieltageinzelergebnisse][{res.uid}][__identity]" value="{res.uid}" /><br />

but values are not updated. What is the correct name attribute to make the update action work?



More information about the TYPO3-project-typo3v4mvc mailing list