[BUGFIX] Allow accessing object from `ObjectStorage` with numeric value 72/58972/7
authorRomain Canon <romain.hydrocanon@gmail.com>
Wed, 28 Nov 2018 16:52:38 +0000 (17:52 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 3 Dec 2018 21:09:55 +0000 (22:09 +0100)
commit621c51d27bac4168d94a68ea9484355a55e1bd43
tree10dcd269451e010cfedffaee662935beb438f714
parentefc6284e485a9c70e2ccc310b72aa8fea73e6bd4
[BUGFIX] Allow accessing object from `ObjectStorage` with numeric value

The following code now works:

```php
$objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
$objectStorage->attach(new \stdClass());
$myObject = $objectStorage->offsetGet(0);
```

And more importantly, the following Fluid code works as well:

<f:image image="{myObject.resources.0}" alt="My image!" />

Resolves: #87028
Releases: master, 8.7
Change-Id: I15890a16540ff2e39a5e48ed83f96a1443bc98ac
Reviewed-on: https://review.typo3.org/58972
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Documentation/Changelog/9.5.x/Important-87028-AccessObjectsFromObjectStorageUsingNumericValue.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php
typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php
typo3/sysext/extbase/Tests/Unit/Persistence/ObjectStorageTest.php