[BUGFIX] Prevent type converters from being registered multiple times 36/56236/2
authorRomain Canon <romain.hydrocanon@gmail.com>
Mon, 2 Oct 2017 22:09:15 +0000 (00:09 +0200)
committerAndreas Wolf <andreas.wolf@typo3.org>
Fri, 16 Mar 2018 15:46:35 +0000 (16:46 +0100)
commitb2408cca8231a813346035aa34196fb6d1d7c32e
tree55f37f696b67df09db0dd19baf8f5ccb7c1f3f17
parenta812bacc251c96c4768673744f0a64c9d1a495ec
[BUGFIX] Prevent type converters from being registered multiple times

Registering an exact same type converter class name with the Exbase method
`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter()` will now
add it only once to the global array.

This will prevent issues that could occur during a strong cache clearing, in
which case the `ext_localconf.php` files are included twice, leading to the
Extbase default type converters being registered twice.

If type converters were to be used early during the runtime (just after the
caches were cleared), a `DuplicateTypeConverterException` would be thrown when
it should not be.

---

Resolves: #82651
Releases: master, 8.7
Change-Id: I01e1f6c2399473ff65c22d9a33f919963f49608f
Reviewed-on: https://review.typo3.org/56236
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php
typo3/sysext/extbase/Tests/Unit/Utility/ExtensionUtilityTest.php