[BUGFIX] Clone ObjectStorage in ObjectAccess 25/53525/4
authorDaniel Goerz <dlg@lightwerk.com>
Sat, 15 Jul 2017 16:45:25 +0000 (18:45 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 17 Jul 2017 08:12:36 +0000 (10:12 +0200)
commit84131835d547d81e1077d8d10a3242b416612131
tree321c37d9c84d42449c9767e56086531343b0d60d
parent6f860bfd0e8b9233c26df8cdcbc43dd77ff25b6f
[BUGFIX] Clone ObjectStorage in ObjectAccess

The ObjectStorage Object passed to iterator_to_array() ends up
with the pointer at the last item, so that any ongoing iteration
through the ObjectStorage wrapping the call of ObjectAccess is
interrupted.
This patch ensures that the ObjectStorage is cloned before converted
to an array so that the original object keeps it original iteration
state.

Resolves: #81597
Relates: #66995
Releases: master, 8.7
Change-Id: Ied025ff616e100cc5eb5dedd5b7b6a95293ddfcf
Reviewed-on: https://review.typo3.org/53525
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Claus Due <claus@phpmind.net>
Reviewed-by: Sascha Rademacher <sascha.rademacher@gmail.com>
Tested-by: Sascha Rademacher <sascha.rademacher@gmail.com>
Reviewed-by: Benjamin Kluge <b.kluge@neusta.de>
Tested-by: Benjamin Kluge <b.kluge@neusta.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php
typo3/sysext/extbase/Tests/Unit/Reflection/ObjectAccessTest.php