Skip to content

Commit

Permalink
[DEPRECATION] Obsolete $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLine… (
Browse files Browse the repository at this point in the history
#1292)

* [DEPRECATION] Obsolete $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']

references: TYPO3-Documentation/Changelog-To-Doc#910
releases: main

* [DEPRECATION] Obsolete $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']

references: TYPO3-Documentation/Changelog-To-Doc#910
releases: main
  • Loading branch information
linawolf authored Jul 2, 2024
1 parent 68988f1 commit afeb3f1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Documentation/Functions/Data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -597,16 +597,17 @@ Get the value of the user-defined field :sql:`tx_myextension_myfield` in the roo
lib.foo.data = levelfield : -1, tx_myextension_myfield, slide
Requires additional configuration in
:ref:`$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] <t3coreapi:typo3ConfVars_fe_addRootLineFields>` to include
field. In order that you can use this function, your field name
:sql:`tx_myextension_myfield` needs be included in the comma
separated list of ['addRootLineFields']:
.. versionchanged:: 13.2

.. code-block:: php
:caption: EXT:my_extension/ext_localconf.php
Until TYPO3 v13 it was required to do additional configuration in
:ref:`$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] <t3coreapi:typo3ConfVars_fe_addRootLineFields>` to
use custom fields.

$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_myextension_myfield';
To stay compatible with both TYPO3 v12 and v13, add the following to your
extensions :file:`ext_localconf.php`:

.. literalinclude:: _Data/_addRootlineFields_ext_localconf.php
:caption: EXT:my_extension/ext_localconf.php

.. _data-type-gettext-levelmedia:

Expand Down
14 changes: 14 additions & 0 deletions Documentation/Functions/_Data/_addRootlineFields_ext_localconf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;

defined('TYPO3') or die();

$versionInformation = GeneralUtility::makeInstance(Typo3Version::class);
// TODO: Remove when dropping TYPO3 v12 support
if ($versionInformation->getMajorVersion() < 13) {
$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_myextension_myfield';
}

0 comments on commit afeb3f1

Please sign in to comment.