Project

General

Profile

Actions

Bug #93527

closed

Assigned form-object does not overwrite default-values

Added by David Henninger over 3 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2021-02-17
Due date:
% Done:

0%

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

Description

In the documentation of input viewhelpers of a form, it states "If used in conjunction with <f:form object='…'>, 'name' and 'value' properties will be ignored."
However only the name property is getting ignored. The (default) value attribute overwrites whatever the assigned object contains.

Testcase:

<f:form name="object" object="{object}">
    With default value: <f:form.textfield type="text" property="withDefaultValue" value="Defaultvalue"/><br/>
    Only default value: <f:form.textfield type="text" property="onlyDefaultValue" value="Defaultvalue"/><br/>
    No default value:   <f:form.textfield type="text" property="noDefaultValue" /><br/>
</f:form>

public function showAction() {
    $this->view->assign('object', [
        "withDefaultValue" => "Value from object",
        "noDefaultValue"   => "Value from object",
    ]);
}

Expected result:
Expected result

Actual result:
Actual result


Files

clipboard-202102171102-ghlih.png (9.53 KB) clipboard-202102171102-ghlih.png Actual result David Henninger, 2021-02-17 10:02
clipboard-202102171102-vucti.png (9.85 KB) clipboard-202102171102-vucti.png Expected result David Henninger, 2021-02-17 10:02

Related issues 1 (1 open0 closed)

Is duplicate of TYPO3 Core - Bug #99243: Wrong behaviour when using property and value togetherUnder Review2022-12-02

Actions
Actions

Also available in: Atom PDF