[DOCS] 7.5 Docs Part 7/4
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / 7.5 / Deprecation-69754-TcaCtrlIconfileUsingRelativePathToExtAndFilenameOnly.rst
1 =================================================================================================================
2 Deprecation: #69754 - Deprecate relative path to extension directory and using filename only in TCA ctrl iconfile
3 =================================================================================================================
4
5 Description
6 ===========
7
8 * Using relative paths to refer to the extension directory for iconfiles in ``TCA['ctrl']['iconfile']`` has been marked as deprecated.
9 * Using filenames only to refer to an iconfile in TCA['ctrl'] has been marked as deprecated.
10
11
12 Impact
13 ======
14
15 * TCA definitions in ``TCA['ctrl']['iconfile']`` containing ``'../typo3conf/ext/'`` or calls to ``\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath()`` will trigger a deprecation log entry.
16 * TCA definitions in ``TCA['ctrl']['iconfile']`` containing a filename only will trigger a deprecation log entry.
17
18
19 Affected Installations
20 ======================
21
22 Any installation with extensions defining ``TCA['ctrl']['iconfile']`` by using ``../typo3conf/ext/`` or only a filename.
23
24
25 Migration
26 =========
27
28 Relative paths
29 --------------
30
31 Use ``EXT:`` instead of relative path ``'../typo3conf/ext/'`` or ``\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath()``, e.g.
32
33 .. code-block:: php
34
35 'ctrl' => array(
36 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('my_extension') . 'Resources/Public/Icons/image.png'
37 ),
38
39 has to be migrated to
40
41 .. code-block:: php
42
43 'ctrl' => array(
44 'iconfile' => 'EXT:my_extension/Resources/Public/Icons/image.png'
45 ),
46
47 Filename only
48 -------------
49
50 Use a full absolute path or an ``EXT:`` definition instead of a filename only:
51
52 .. code-block:: php
53
54 'ctrl' => array(
55 'iconfile' => '_icon_ftp.gif'
56 ),
57
58 has to be migrated to
59
60 .. code-block:: php
61
62 'ctrl' => array(
63 'iconfile' => 'EXT:t3skin/icons/gfx/i/_icon_ftp.gif'
64 ),
65
66 or
67
68 .. code-block:: php
69
70 'ctrl' => array(
71 // You can use absolute paths (to your web root folder) to the icons but
72 // it is discouraged to do so as these icons belong to an extension they
73 // should also be stored in this extension
74 'iconfile' => '/fileadmin/icons/_icon_ftp.gif'
75 ),