Deprecation: #101475 - Icon::SIZE_* string constants¶
See forge#101475
Description¶
The string constants representing icon sizes have been marked as deprecated:
\TYPO3\CMS\Core\Imaging\Icon::SIZE_DEFAULT
\TYPO3\CMS\Core\Imaging\Icon::SIZE_SMALL
\TYPO3\CMS\Core\Imaging\Icon::SIZE_MEDIUM
\TYPO3\CMS\Core\Imaging\Icon::SIZE_LARGE
\TYPO3\CMS\Core\Imaging\Icon::SIZE_MEGA
The following methods have been adapted to still accept the deprecated string
constants and the new \TYPO3\CMS\Core\Imaging\IconSize
enum:
\TYPO3\CMS\Core\Imaging\Icon->setSize()
\TYPO3\CMS\Core\Imaging\IconFactory->getIcon()
\TYPO3\CMS\Core\Imaging\IconFactory->getIconForFileExtension()
\TYPO3\CMS\Core\Imaging\IconFactory->getIconForRecord()
\TYPO3\CMS\Core\Imaging\IconFactory->getIconForResource()
The following method returns the string value of an IconSize
enum, but
will be removed in TYPO3 v14:
\TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent->getSize()
Impact¶
Passing the size as a string in the above mentioned methods will trigger a deprecation log entry.
Affected installations¶
All installations with third-party extensions using the Icon API are affected.
Migration¶
Migrate all usages of the aforementioned string constants to the IconSize
as follows:
\TYPO3\CMS\Core\Imaging\Icon::SIZE_DEFAULT
->\TYPO3\CMS\Core\Imaging\IconSize::DEFAULT
\TYPO3\CMS\Core\Imaging\Icon::SIZE_SMALL
->\TYPO3\CMS\Core\Imaging\IconSize::SMALL
\TYPO3\CMS\Core\Imaging\Icon::SIZE_MEDIUM
->\TYPO3\CMS\Core\Imaging\IconSize::MEDIUM
\TYPO3\CMS\Core\Imaging\Icon::SIZE_LARGE
->\TYPO3\CMS\Core\Imaging\IconSize::LARGE
\TYPO3\CMS\Core\Imaging\Icon::SIZE_MEGA
->\TYPO3\CMS\Core\Imaging\IconSize::MEGA
Also migrate from \TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent->getSize()
to \TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent->getIconSize()
.