[BUGFIX] DataMapper returns array on RELATION_HAS_ONE
authorThomas Maroschik <tmaroschik@dfau.de>
Fri, 1 Apr 2011 12:59:43 +0000 (14:59 +0200)
committerMarkus Günther <mail@markus-guenther.de>
Thu, 9 Aug 2012 16:49:41 +0000 (18:49 +0200)
commit4f2eac09401d1fd7e6978a436c92ef0321e8b7fe
tree9d0dae0f909129b4f49c180c9ceb20dceb45dd9b
parented5512fb16e1384b31657372d316ba9a16d53b08
[BUGFIX] DataMapper returns array on RELATION_HAS_ONE

When your dealing with entities, that not necessarily have
their hasOne nested entities set then the DataMapper returns
an empty array instead of null. In my opinion, an empty
array makes no sense here, because there is no hasMany
relation here.

* Removed the unused $columnMap from DataMapper::fetchRelated
* Added $columnMap in DataMapper::fetchRelatedEager
* Check if the property has a RELATION_HAS_ONE and return null
  instead of an empty array then

Change-Id: I0c766d9579cbb464bbae292b194f8df7e8c4a9e9
Fixes: #25708
Releases: 6.0, 4.7
Reviewed-on: http://review.typo3.org/1404
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Stefan Neufeind
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Markus Günther
Tested-by: Markus Günther
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
typo3/sysext/extbase/Tests/Unit/Persistence/Mapper/DataMapperTest.php [new file with mode: 0644]