[TYPO3-core] RFC #13250: Bug: Translation handling for IRRE combo records broken

Marcel Greter mgr at rtpartner.ch
Tue Apr 20 17:05:47 CEST 2010


Hi Susanne/list,

I checked myself and you're right, my patch did not yet fix this bug ;-)

-			if ($config['localizationMode']=='select') {
+			if ($config['behaviour']['localizationMode']=='select') {
 				$parentRecord = $this->getRecord(0, $parent['table'], $parent['uid']);
 				$parentLanguageField = $GLOBALS['TCA'][$parent['table']]['ctrl']['languageField'];
 				$childLanguageField = $GLOBALS['TCA'][$current['table']]['ctrl']['languageField'];
-				if ($parentRecord[$languageField]>0) {
-					$record[$childLanguageField] = $parentRecord[$languageField];
+				if ($parentRecord[$parentLanguageField]>0) {
+					$record[$childLanguageField] = $parentRecord[$parentLanguageField];
 				}
 			}

Not sure why I missed that one.
I know I had it working when I posted the first patch.
Anyway, that seems to fix the problem.

My patch also fixes another bug which is exposed within "m:n asymmetric combo" (alt language -> create new).
With only the patch above, the new relation record will have the correct language but the combo record not.
Screenshot: http://bayimg.com/image/iamdaaaca.jpg

+				// set language for new records to the same as the given record
+				$relationLanguageField = $GLOBALS['TCA'][$config['foreign_table']]['ctrl']['languageField'];
+				$recordLanguageField = $GLOBALS['TCA'][$comboConfig['foreign_table']]['ctrl']['languageField'];
+				if ($rec[$relationLanguageField]>0) {
+					$comboRecord[$recordLanguageField] = $rec[$relationLanguageField];
+				}

Have a nice Day!

Marcel Greter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: t3bug-0013250.patch
Type: application/octet-stream
Size: 1552 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100420/3966e96e/attachment-0001.obj>


More information about the TYPO3-team-core mailing list