Project

General

Profile

Actions

Bug #19527

closed

getIcon does not return correct icon

Added by Niels Fröhling about 16 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-10-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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)

Actions #1

Updated by Alexander Opitz over 11 years ago

  • Status changed from Accepted to Needs Feedback
  • Target version deleted (0)

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #2

Updated by Alexander Opitz about 11 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Benni Mack)
  • Is Regression set to No

No feedback for over 90 days.

Actions

Also available in: Atom PDF