Issue Bug Closed

#59253Additional Identity Properties not set on mapping error

Anja Leichsenring 06/01/14, 10:42 updated 10/02/18, 11:56

Description

Backport from #29290, see this issue for detailed problem description

When binding Fluid forms to nested objects, Fluid automatically adds
hidden fields with the identifiers of all affected objects so that
the persistence layer can update all objects correctly.

When a form was redisplayed due to property mapping errors, the
identity fields for the nested sub objects were no longer created.

This change fixes this by making sure all identity fields are rendered
recursively also after property mapping errors.

Example code to verify this::
<f:form action="update" object="{user}" objectname="user"><br> <f:form property="firstName"></f:form><br> <f:for each="{user.invoices}" as="invoice" iteration="iteration"> {iteration.cycle}:<br> <f:form property="invoices.{iteration.index}.subject"></f:form><br> </f:for><br> <f:form value="update"></f:form><br> </f:form>

When submitting the form with validation errors, the redisplayed form
should contain a div with a hidden field named
“user[__identity]” for the user and one for each invoice.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.