Project

General

Profile

Actions

Bug #66588

closed

POST Data in selectviewhelper should have higher priority than "value" value

Added by Simon Schaufelberger almost 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Fluid
Target version:
Start date:
2015-04-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

given the following fluid:

<f:form.select name="myname" options="{myoptions}" value="50" />

and submitting the form with an error, the item with value 50 is always selected no matter what other value i selected before.

I would call value a default value and not a "always select" value.

A workaround would of course be to make "value" also a variable and handle the default and overwrite stuff in controller but this is really ugly!

here lies the problem: https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php#l106

first the value is checked if it exists but never $value = $this->getLastSubmittedFormData(); in the case value is not an object itself.

Expected result:
POST Data should be checked BEFORE the default value is returned.

If possible please backport this bug to older TYPO3 versions!

Actions

Also available in: Atom PDF