Project

General

Profile

Actions

Bug #82457

closed

OptionViewHelper ignores empty value

Added by Raphael Graf over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2017-09-11
Due date:
% Done:

100%

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

Description

The following code does not produce two selects with the same options:

<f:form.select name="select1" options="{options}" />
<f:form.select name="select2">
    <f:for each="{options}" key="key" as="value">
        <f:form.select.option value="{key}">{value}</f:form.select.option>
    </f:for>
</f:form.select>

$options = ['' => 'empty', 'foo' => 'bar'];
$this->view->assign($options);

The resulting HTML:

<select name="select1">
    <option value="">empty</option>
    <option value="foo">bar</option>
</select>
<select name="select2">
    <option>empty</option>
    <option value="foo">bar</option>
</select>

Note that the submitted value differs if the first option is selected.

Actions

Also available in: Atom PDF