Closed Schweriner closed 2 years ago
Please check, if it is related to #815
Took a long look at it before but none of the mentioned "possible solutions" worked for the detail view. But yes probably its related.
Any solutions or fixes on this issue in news detail view? Still valid with TYPO3 9.5.13 and News 7.3.1
Hm, I guess the problem is the property mapper that calls
\TYPO3\CMS\Extbase\Persistence\Generic\Backend::getObjectByIdentifier
to retrieve the objects and this sets
$query->getQuerySettings()->setRespectSysLanguage(false); $query->getQuerySettings()->setLanguageOverlayMode(true);
and this is not what we want here.
I'll solve this for a client project (I hope) by using the SIGNAL_NEWS_DETAIL_ACTION signal and fetching the news record there again.
Solved (for me) by using the slot
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(
\GeorgRinger\News\Controller\NewsController::class,
'detailAction',
\Vendor\Extension\Slots\NewsControllerSlot::class,
'detailActionSlot',
true
);
and the method
class NewsControllerSlot
{
…
/**
* @param News $news
* @param int $currentPage
* @param NewsDemand $demand
* @param array $settings
* @param array $extendedVariables
* @return array
*/
public function detailActionSlot(
?News $news,
int $currentPage,
NewsDemand $demand,
array $settings,
array $extendedVariables
): array {
if ($news) {
$repository = GeneralUtility::makeInstance(NewsRepository::class);
$news = $repository->findByUid($news->getUid());
}
return [
'newsItem' => $news,
'currentPage' => $currentPage,
'demand' => $demand,
'settings' => $settings,
'extendedVariables' => $extendedVariables
];
}
}
closing this issue because core issue or integrator job, using e.g. this slot
Hey out there,
I've got a problem with the actual versions. I don't want news to be shown in other languages detail view if they have not been translated. But this, however does not work.
config.sys_language_overlay hideNonTranslated
should do the job - but it doesnt. It will always fallback to the default languages news detail.Maybe this is related to: (?) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5/Important-82363-MakeExtBaseTranslationHandlingConsistentWithTyposcript.html