Bug #20222
closedgetRecordOverlay returns wrong localization (for tt-news 2.5.2)
0%
Description
We've encountered some strange behaviour when using tt_news 2.5.2 in one of our multilingual sites.
On one of our pages we have an archive view of all the newsitems per language. So the English site will only display English news and if we click on the Dutch flag, we only see the Dutch items. So far so good.
The strange behaviour happens when we singleview a localized news item without default translation: if we switch the language of e.g. a Dutch news item (without default translation) to the default language (English), tt_news still displays the item (in Dutch). Switching the Dutch-only item to other languages will result in the "Sorry, there is no translation.." message, wich seems correct behaviour to me.
We recently tracked this problem down to line 540 of class.tx_ttnews.php wich is:
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tt_news', $row, $GLOBALS['TSFE']->sys_language_content, $OLmode);
This line should return false, because no translated records exist with sys_language_uid = 0 but instead it returns the original tt_news record.
Site is configured with:
config.sys_language_mode = strict
config.sys_language_overlay = 0
plugin.tt_news.showNewsWithoutDefaultTranslation = 1
tt_news 2.5.2
realurl 1.5.3 (bug also happens when real url is disabled)
sr_language_menu 1.4.0
php 5.2.8
mysql 5.0.75
(issue imported from #M10745)