Bug #52068

ArrayConverter should accept empty strings

Added by Christian Eßl almost 2 years ago. Updated almost 2 years ago.

Status:Closed Start date:2013-09-17
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:Property
Target version:-
PHP Version: Complexity:
Has patch:Yes Affected Flow version:Flow 2.0.0

Description

Imagine a select-box like this:

<label for="categories">Categories:</label> 
<select name="content[categories][]" multiple="TRUE" id="categories">
  <option value="0">Category 1</option>
  <option value="1">Category 2</option>
  <option value="2">Category 3</option>
</select>

with this array-property:

/**
 * @var array 
 */ 
protected $categories;

The select box allows multiple selected categories and none is selected by default.

If you submit the form without selecting any category, the PropertyMapper throws the exception:

No converter found which can be used to convert from" "string" to "array".

The property mapper treats the empty values of the categories-select as string.
Shouldn't in this case the ArrayConverter accept empty strings and convert them to an empty array()?


Related issues

duplicates TYPO3 Flow Base Distribution - Task #48148: Allow PropertyMapping of strings to arrays Resolved 2013-05-13

History

#1 Updated by Adrian Föder almost 2 years ago

  • Category set to Property
  • Status changed from New to Closed
  • Has patch changed from No to Yes

Also available in: Atom PDF