Bug #19527
closedgetIcon does not return correct icon
0%
Description
--- How to reproduce: ---
1. assign your own icon:
$TCA['tt_content']['ctrl']['typeicons']['templavoila_pi1'] = 'tt_content_fce.gif';
2. provide alternative skin-image
$TBE_STYLES['skinImg'] = array_merge($presetSkinImgs, array (
'gfx/i/tt_content_fce__h.gif' => array($extRelPath . 'icons/gfx/i/tt_content_fce__h.png', 'width="16" height="16"')));
3. create a FCE-ttcontent-element
4. hide it
5. enjoy the default "no_icon_found" icon
--- explanation: ---
getIcon() assigns "no_icon_found" to EVERY icon not in the gfx/i-hierarchy, and makes it thus impossible to provide custom icons with flags, and moreso does not allow to skin those
--- solution (this is a fast hack): ---
double check if the icon is not possibly given by skinning (will not work correctly if you'd call getIcon directly):
if (@is_file(dirname($absfile).'/'.$iconFileName_X)) {
return dirname($iconfile).'/'.$iconFileName_X;
} else {
$findme = dirname($iconfile).'/'.$iconFileName_stateTagged;
$search = t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $findme, '', 1);
if ($search != $findme)
return $findme;
$findme = dirname($iconfile).'/'.$iconFileName_X;
$search = t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $findme, '', 1);
if ($search != $findme)
return $findme;
return 'gfx/i/no_icon_found.gif';
}
(issue imported from #M9680)