[BUGFIX] Prevent type converters from being registered multiple times 63/54263/3
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:33:49 +0000 (16:33 +0100)
commit7321564b4b39d6d17014cf3425c1e681c7484ab7
tree2a01aa02664dce220e6613c8d01a60ecb186ab6f
parentcfa9bcbd5355f4a69224fc6b42d1e4b1902983c0
[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/54263
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
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