Issue Bug Needs Feedback Orphaned

#106762Fluid f:form.* ViewHelpers do not behave like documented when using property and value in conjunction

S P 05/26/25, 09:13 updated 05/26/25, 19:07

Description

The documentation of, for example, the f:form.textfield VH says

> property
> Name of Object Property. If used in conjunction with <f:form object="...">, the “name” property will be ignored, while “value” can be used to specify a <strong>default</strong> field value instead of the object property value.</f:form>

This sounds that one can use value to specify a default fallback value if the object of the form does not contain the property (i.e. !isset()).

However, the actual behaviour: when specifying value it always wins over the actual property in the object. Either this is a bug in the VH API or in the documentation.

Not sure whether this is relevant, as object I am using an array, which works totally fine elsewise. In my use-case I can not use an actual class instance, because I have dynamically built forms, so can not define a hard-coded DTO class (which would require to know all fields beforehand). So maybe this is only a bug when using an array.

Intuitively I’d expect it to behave like the documentation says (so, bug in VH, not in docs):
if a property isset(), then the value from the property is taken, else (and only then!) pre-fill with the value.

Reviews 0

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

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Fluid f:form.* ViewHelpers do not behave like documented when using property and value in conjunction Resolves: #106762 Releases: main