Bug #49566
NULL source values are not handled correctly
Status: | New | Start date: | 2013-07-02 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Adrian Föder | % Done: | 0% |
|
Category: | Property | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | Git master |
Description
currently, for example
$this->propertyMapper->convert(NULL, 'array')
results into a message
No converter found which can be used to convert from "string" to "array"
which is at least incorrect for the source type, IMO the converter should return NULL then, too (i.e. leave the property untouched).
I found this change here being relevant for this, https://review.typo3.org/#/c/1895/3/Classes/Property/PropertyMapper.php There, the $source is hard-coded set to an empty string if it's NULL; I can't see a proper reason for that, since when deleting these lines all Tests still pass. Additionally, the tests for \TYPO3\Flow\Tests\Unit\Property\PropertyMapperTest::sourceWhichIsNoSimpleTypeThrowsException https://git.typo3.org/Packages/TYPO3.Flow.git/blob/master:/Tests/Unit/Property/PropertyMapperTest.php#l75 won't make any sense then.
Related issues