Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEPRECATION] Obsolete $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLine… #1292

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
}
froemken marked this conversation as resolved.
Show resolved Hide resolved
Loading