Bug #82457

OptionViewHelper ignores empty value

Added by Raphael Graf 2 months ago. Updated about 2 months ago.

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

100%

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.

Associated revisions

Revision d2ef6127 (diff)
Added by Raphael Graf about 2 months ago

[BUGFIX] Do not ignore empty value in OptionViewHelper

Resolves: #82457
Releases: master
Change-Id: I42a1fdb85e87db4601ceefdd52e0dd4f1722bd23
Reviewed-on: https://review.typo3.org/54122
Tested-by: TYPO3com <>
Reviewed-by: Joerg Boesche <>
Reviewed-by: David Hoeckele <>
Reviewed-by: Markus Sommer <>
Tested-by: Markus Sommer <>
Reviewed-by: Sascha Rademacher <>
Tested-by: Sascha Rademacher <>
Reviewed-by: Jan Stockfisch <>
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>

History

#1 Updated by Gerrit Code Review 2 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54122

#2 Updated by Raphael Graf about 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF