Bug #49566

NULL source values are not handled correctly

Added by Adrian Föder about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Should have
Assignee:
Category:
Property
Target version:
-
Start date:
2013-07-02
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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

Related to TYPO3.Flow - Feature #37294: Property converters should allow NULL resultsClosedCarsten Bleicker2012-05-19

Actions

No data to display

Also available in: Atom PDF