[TYPO3-dev] Bug? No language-merging for cType RECORDS - so also not for TV!?!

Franz Koch typo3 at fx-graefix.de
Sat Mar 4 21:37:03 CET 2006


I made some changes to my local core-files and everything seems to work 
- at least the merging works now for both - CONTENT and RECORDS cType.
Also seems to work with workspaces, versioning etc. Haven't checked 
content fallback yet, but I hope it works, too.

If anybody also thinks that this is a bug I'll put my code to 
bugtracker. But unfortunately I cannot provide a .diff file as I don't 
know how this stuff works.


btw. typo3 4.0 Beta3

For testing, here are my changes:


----- class.tslib_content.php around line 6584 ------------
# from:
		if ($conf['languageField'])	{
			if ($GLOBALS['TSFE']->sys_language_contentOL && $TCA[$table] && 
$TCA[$table]['ctrl']['languageField'] && 
$TCA[$table]['ctrl']['transOrigPointerField'])	{
					// Sys language content is set to zero/-1 - and it is expected that 
whatever routine processes the output will OVERLAY the records with 
localized versions!
				$sys_language_content = '0,-1';
			} else {
				$sys_language_content = intval($GLOBALS['TSFE']->sys_language_content);
			}
			$query.=' AND '.$conf['languageField'].' IN ('.$sys_language_content.')';
		}

# to:
		if($TCA[$table] && ($TCA[$table]['ctrl']['languageField'] || 
$conf['languageField'])) {
			$lField = $conf['languageField']? $conf['languageField'] : 
$TCA[$table]['ctrl']['languageField'];
			$query.=' AND '.$lField.' IN 
('.$GLOBALS['TSFE']->sys_language_content.')';
		}
-----------------------------------------------------------


----- class.t3lib_page.php line 324 -----------------------
# from:	if ($row[$TCA[$table]['ctrl']['languageField']]<=0)	{
# to:	if ($row[$TCA[$table]['ctrl']['languageField']] > 0)	{
-----------------------------------------------------------


----- class.t3lib_page.php around line 330-----------------
# from:
' AND 
'.$TCA[$table]['ctrl']['languageField'].'='.intval($sys_language_content).
' AND 
'.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']).

# to:
' AND '.$TCA[$table]['ctrl']['languageField'].' IN (0,-1)'.
' AND uid='.intval($row['l18n_parent']).
-----------------------------------------------------------


----- class.t3lib_page.php around line 345-----------------
# from:
if ($fN!='uid' && $fN!='pid' && isset($olrow[$fN]))	{
	if ($GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN]!='exclude'
	&& 
($GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN]!='mergeIfNotBlank' 
|| strcmp(trim($olrow[$fN]),'')))	{
		$row[$fN] = $olrow[$fN];
	}
}

# to:
if ($fN!='uid' && $fN!='pid' && isset($row[$fN]))	{
	if (($GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN]=='exclude'
	|| 
$GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN]=='mergeIfNotBlank') 
&& !strcmp(trim($row[$fN]),''))	{
		$row[$fN] = $olrow[$fN];
	}
}
-----------------------------------------------------------



All in all I spent several hours to find the 'bug' and fix it. So I hope 
somebody can a) proof the bug, b) check the patch and c) integrate it 
into the core.

And now it's time for TV ;)
-- 
Kind regards,
Franz Koch




More information about the TYPO3-dev mailing list