Deprecation: #85389 - Various public properties in favor of Context API

See forge#85389

Description

The following properties have been marked as deprecated in favor of the newly introduced Context API:

  • TypoScriptFrontendController->loginUser

  • TypoScriptFrontendController->gr_list

  • TypoScriptFrontendController->beUserLogin

  • TypoScriptFrontendController->showHiddenPage

  • TypoScriptFrontendController->showHiddenRecords

The Context API supersedes the public properties in favor of decoupling the information from global objects.

Impact

Reading or writing information on any of the public properties will trigger a PHP E_USER_DEPRECATED error, however the value is still stored and contains the same information as before.

Affected Installations

Any TYPO3 installation using extensions accessing this kind of information.

Migration

Use Context API / Aspects instead to read from this information. Instantiate the context object and get an aspect:

  • $context = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Context\Context::class);

  • $context->getPropertyFromAspect('visibility', 'includeHiddenPages') instead of $TSFE->showHiddenPage

  • $context->getPropertyFromAspect('visibility', 'includeHiddenContent') instead of $TSFE->showHiddenRecords

  • $context->getPropertyFromAspect('frontend.user', 'isLoggedIn') instead of $TSFE->loginUser

  • $context->getPropertyFromAspect('backend.user', 'isLoggedIn') instead of $TSFE->beUserLogin

  • $context->getPropertyFromAspect('frontend.user', 'groupIds') instead of $TSFE->gr_list

For more information see Context API chapter in TYPO3 Explained.