[TASK] Deprecate cObject FILE
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / Deprecation-85970-FileContentObject.rst
1 .. include:: ../../Includes.txt
2
3 =========================================
4 Deprecation: #85970 - FILE content object
5 =========================================
6
7 See :issue:`85970`
8
9 Description
10 ===========
11
12 The cObject FILE is mixing concerns (rendering an image, or dumping file contents), and
13 rather became low-level since Fluid's rise in rendering Frontend.
14
15 FILE shows an image if the file is jpg,jpeg,gif,png (but not SVG), and if has a
16 different file ending, it will check if the file is less than 1MB, it will get its contents
17 and output that. If the file is 1 byte bigger, nothing is done.
18 Fluid offers more flexibility nowadays.
19
20 Thus, cObject FILE will be removed in TYPO3 v10.
21
22
23 Impact
24 ======
25
26 Instances using the TypoScript cObject :typoscript:`FILE` will find PHP :php:`E_USER_DEPRECATED` errors for each usage.
27
28
29 Affected Installations
30 ======================
31
32 Instances using the TypoScript cObject :typoscript:`FILE`.
33
34
35 Migration
36 =========
37
38 Use :typoscript:`IMAGE` to show images instead.
39
40 For realising :typoscript:`TEMPLATE`, migrate to using :typoscript:`FLUIDTEMPLATE`. It comes with all
41 the benefits Fluid offers.
42
43 However due to the flexibility of custom cObject, an extension author could just re-implement
44 the functionality in a custom extension within minutes.
45 See this example for ext:frontend where the registration resides in :file:`ext_localconf.php`.
46
47 .. codeblock:: php
48
49 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'] = array_merge(
50 $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'],
51 [
52 'FILE' => \TYPO3\CMS\Frontend\ContentObject\FileContentObject::class,
53 ],
54 );
55
56
57 .. index:: TypoScript, NotScanned