e436dab998dc385229a83bdf8d9d9a524f8695b5
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / 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 deprecated.
9 * Using filenames only to refer to an iconfile in TCA['ctrl'] has been 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 message in the deprecation log.
16 * TCA definitions in ``TCA['ctrl']['iconfile']`` containing a filename only will trigger a message in the deprecation log.
17
18
19 Affected Installations
20 ======================
21
22 Any installation with extensions defining ``TCA['ctrl']['iconfile']`` by using ``../typo3conf/ext/`` or a filename only.
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 File name 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 'iconfile' => '/fileadmin/icons/_icon_ftp.gif'
72 ),