Project

General

Profile

Actions

Bug #99243

closed

Wrong behaviour when using property and value together

Added by Josua Vogel almost 2 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Category:
Fluid
Target version:
-
Start date:
2022-12-02
Due date:
% Done:

100%

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

Description

According to the docs, name and value should be ignored, if property is set. I`m using the view helper like this:

<f:form.textfield
                    id="{id}" 
                    name="customName" 
                    property="{property}" 
                    value="customValue" 
                    placeholder="{placeholder}" 
                    class="input__field form-control{f:if(condition: '{class}', then: ' {class}')}" 
                    errorClass="{errorClass}" 
                    additionalAttributes="{additionalAttributes}" 
                    data="{data}" 
                    aria="{describedby: 'error-label-{id}'}" 
                />

This is the result:

<input required="required" aria-describedby="error-label-email" class="input__field form-control" id="email" type="text" name="tx_myextension[customerData][email]" value="customValue">

The name attribute is ignored, but not the value attribute.
I´m not sure, what is wrong. Maybe the code, maybe the docs.

Inside the view helper, I found this part:

* The value is determined as follows:
     * * If property mapping errors occurred and the form is re-displayed, the *last submitted* value is returned
     * * Else the bound property is returned (only in objectAccessor-mode)
     * * As fallback the "value" argument of this ViewHelper is used

if ($this->respectSubmittedDataValue) {
            $value = $this->getValueFromSubmittedFormData($value);
        } elseif ($this->hasArgument('value')) {
            $value = $this->arguments['value'];
        } elseif ($this->isObjectAccessorMode()) {
            $value = $this->getPropertyValue();
        }

I can fix this, if someone tells me, which would be the correct behaviour.


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #93527: Assigned form-object does not overwrite default-valuesClosed2021-02-17

Actions
Actions

Also available in: Atom PDF