Issue Bug Needs Feedback Stale

#110718BackendUtility::getPagesTSconfig never matched [siteLanguage("languageId") == 1] even though English is configured with language ID 1 in the site configuration.

Heiko Dietrich 09/16/26, 08:28 updated 09/16/26, 08:38

Description

I need to evaluate language-specific TSconfig inside a custom Form Finisher.

class DownloadFinisher extends \TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher
{

    protected function executeInternal(): void
    {
        $languageId = $this->getCurrentLanguageId();

        //$languageId is 1, but [siteLanguage("languageId") == 1] never matched
        $config = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($this->getCurrentPageId());
    }

    protected function getCurrentPageId(): int
    {
        return (int) $this
            ->getFinisherContext()
            ->getRequest()
            ->getAttribute('routing')
            ->getPageId();
    }

    protected function getCurrentLanguageId(): int
    {
        return (int) $this->getFinisherContext()
            ->getRequest()
            ->getAttribute('language')
            ->getLanguageId();
    }
}

For this purpose, I retrieve the TSconfig using:

\TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($pageId);

The following condition is evaluated correctly:

[siteLanguage("languageId") == 0]

However, this condition is never matched:

[siteLanguage("languageId") == 1]

even though English is configured with language ID 1 in the site configuration.

It appears that BackendUtility::getPagesTSconfig() always compiles/evaluates the TSconfig in the default language context (languageId = 0), regardless of the actual language used by the form submission.

Has anyone experienced similar behavior with siteLanguage() conditions when TSconfig is evaluated from within a Form Finisher or via BackendUtility::getPagesTSconfig()? Is there a recommended approach for implementing language-specific TSconfig in this context?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] BackendUtility::getPagesTSconfig never matched [siteLanguage("languageId") == 1] even though English is configured with language ID 1 in the site configuration. Resolves: #110718 Releases: main