We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This diff shows updates made to the AddNewsToMenuProcessor.php file to fix the translated data sets.
--- AddNewsToMenuProcessor.php 2025-01-23 12:14:56 +++ AddNewsToMenuProcessor-copy.php 2025-01-23 12:14:19 @@ -81,6 +81,8 @@ $newsId = (int)($routing->getArguments()['tx_news_pi1']['news'] ?? 0); if ($newsId) { + // Get the current language ID + $languageId = $this->getCurrentLanguage(); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('tx_news_domain_model_news'); $row = $queryBuilder @@ -92,7 +94,20 @@ ->executeQuery()->fetchAssociative(); if ($row) { - $row = $this->getTsfe()->sys_page->getLanguageOverlay('tx_news_domain_model_news', $row, $this->getCurrentLanguageAspect()); + if ($languageId > 0) { + $translatedRow = $queryBuilder + ->select('*') + ->from('tx_news_domain_model_news') + ->where( + $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($newsId, Connection::PARAM_INT)), + $queryBuilder->expr()->eq('sys_language_uid', $queryBuilder->createNamedParameter($languageId, Connection::PARAM_INT)) + ) + ->executeQuery()->fetchAssociative(); + + if ($translatedRow) { + $row = $translatedRow; + } + } } if (is_array($row) && !empty($row)) {
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This diff shows updates made to the AddNewsToMenuProcessor.php file to fix the translated data sets.
The text was updated successfully, but these errors were encountered: