fusion-form icon indicating copy to clipboard operation
fusion-form copied to clipboard

"Empty" forms lack entity identifier when submitted

Open kdambekalns opened this issue 1 year ago • 0 comments

When using a form like this for calling a delete action (deleteAction(Company $company)), the required argument is missing, even though props.company contains the correct entity:

<Neos.Fusion.Form:Form form.data.company={props.company} form.target.action={"delete"}>
    <button type="submit" class="neos-button neos-button-danger" title="Eintrag löschen">
        Ja, diesen Eintrag löschen
    </button>
</Neos.Fusion.Form:Form>

When "using" something from the entity like below, it works:

<Neos.Fusion.Form:Form form.data.company={props.company} form.target.action={"delete"}>
    <!-- Necessary to enable the delete method, without this hidden field the identity were -->                           
    <Neos.Fusion.Form:Neos.BackendModule.FieldContainer field.name="company[description]" label="">
        <Neos.Fusion.Form:Hidden/>
    </Neos.Fusion.Form:Neos.BackendModule.FieldContainer>

    <button type="submit" class="neos-button neos-button-danger" title="Eintrag löschen">
        Ja, diesen Eintrag löschen
    </button>
</Neos.Fusion.Form:Form>

Feels wrong to me…

kdambekalns avatar Sep 05 '23 15:09 kdambekalns