Deprecation: #92551 - GeneralUtility methods related to pages.l18n_cfg behavior 

See forge#92551

Description 

The methods

  • GeneralUtility::hideIfNotTranslated()
  • GeneralUtility::hideIfDefaultLanguage()

have been marked as deprecated in favor of a new BitSet-based PHP class \TYPO3\CMS\Core\Type\Bitmask\PageTranslationVisibility .

Impact 

Calling both methods will trigger a PHP E_USER_DEPRECATED error.

Affected Installations 

TYPO3 installation with custom third-party extensions calling these methods for explicit and special page translation handling.

Migration 

Instead of GeneralUtility::hideIfDefaultLanguage() use

$pageTranslationVisibility = new PageTranslationVisibility((int)$page['l18n_cfg'] ?? 0)
$pageTranslationVisibility->shouldBeHiddenInDefaultLanguage()
Copied!

Instead of GeneralUtility::hideIfNotTranslated() use

$pageTranslationVisibility = new PageTranslationVisibility((int)$page['l18n_cfg'] ?? 0)
$pageTranslationVisibility->shouldHideTranslationIfNoTranslatedRecordExists()
Copied!