[BUGFIX] Clone ObjectStorage in ObjectAccess 33/53533/2
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 09:12:24 +0000 (11:12 +0200)
commita8d502ac83da488982c48342c5e2717ab63e2ee5
tree15a468d936edd01f39bcf8d9fb15b1e8ebad8fb5
parent9e8f8cab6b29c6c649ec5583e0af0a3941a48197
[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/53533
Tested-by: TYPO3com <no-reply@typo3.com>
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