Open tbsschmdt opened 7 months ago
I lack an overall view but it seems that the TYPO3 core uses FormEngineUtility::getIconHtml() to render icon markup from either icon paths or icon identifiers.
Hi, sorry for the long delay... have a few time for OSS. Could you provide me a small test extension to reproduce the bug? That could be faster for me.
Same issue happens here on the latest v12.
It seems that also Mask elements seem to break the Addional Reports page.
Error when having an icon identifier (which Mask seems to create on the fly / by itself):
TYPO3\CMS\Core\Utility\PathUtility::getAbsoluteWebPath(): Argument #1 ($targetPath) must be of type string, null given, called in /var/www/html/vendor/apen/additional_reports/Classes/Utility.php on line 290
Error when using no icon or icon from the root directory of the extension /example_ext/ext_icon.png:
EXT:example_ext/ext_icon.png is expected to be in public directory, but it is not
So you should be able to reproduce the error simply by installing mask/mask and create one simple element without an icon. But even setting an icon breaks your code.
I could fix the error by editing your core extension files and adding two !empty() conditions:
addional_reports/Classes/Utility.php - Line 259: -- if (PathUtility::isExtensionPath($itemValue['icon'])) { ++ if (!empty($itemValue['icon']) && PathUtility::isExtensionPath($itemValue['icon'])) {
addional_reports/Classes/Utility.php - Line 287: -- if (str_contains($icon['options']['source'], 'EXT:')) { ++ if (!empty($icon['options']['source']) && str_contains($icon['options']['source'], 'EXT:')) {
addional_reports/Classes/Utility.php - Line 289: -- } else { ++ } elseif(!empty($icon['options']['source']) && str_contains($icon['options']['source'], 'http')) {
Best Regards Dennis
In TYPO3 11 current version 3.4.7 breaks Plugins & Content Types report under certain circumstances. If a plugin uses an icon identifier instead of a path the method
getPublicResourceWebPath
in sysext/core/Classes/Utility/PathUtility.php throws the following error:This method is called in method
getContentInfosFromTca
in additional_reports/Classes/Utility.php, line 266. This error has been introduced with commit d283b8b.You can register an icon in ext_localconf.php (or since TYPO3 11.4 in Icons.php):
Then you can use the icon identifier in method
addPlugin()
: