Project

General

Profile

Actions

Bug #106762

open

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

Added by S P 24 days ago. Updated 24 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2025-05-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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 default field value instead of the object property value.

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #101182: Checkbox is always checked for each value in a form with object property with a valueRejected2023-06-27

Actions
Actions #1

Updated by S P 24 days ago

  • Description updated (diff)
Actions #2

Updated by Garvin Hicking 24 days ago

  • Status changed from New to Needs Feedback

I also think Entity objects will probably work differently than arrays here.

We would need test cases for this to cover the possible scenarios.

Would you like to list the cases with their expected and actual outcomes? For object and arrays, each with their states "unsubmitted form", "submitted form with errors", "submitted form when persisted and redisplayed". That would help a lot to pick this up.

Actions #3

Updated by Garvin Hicking 24 days ago

  • Related to Bug #101182: Checkbox is always checked for each value in a form with object property with a value added
Actions

Also available in: Atom PDF