class.t3lib_tceforms_inline.php.v2.patch

Administrator Admin, 2010-04-20 17:09

Download (1.52 KB)

View differences:

class.t3lib_tceforms_inline.php 2010-04-20 16:43:50.000000000 +0200
741 741
					$this->inlineFirstPid,
742 742
					$comboConfig['foreign_table']
743 743
				);
744
				// set language for new records to the same as the given record
745
				$relationLanguageField = $GLOBALS['TCA'][$config['foreign_table']]['ctrl']['languageField'];
746
				$recordLanguageField = $GLOBALS['TCA'][$comboConfig['foreign_table']]['ctrl']['languageField'];
747
				if ($rec[$relationLanguageField]>0) {
748
					$comboRecord[$recordLanguageField] = $rec[$relationLanguageField];
749
				}
744 750
				$isNewRecord = true;
745 751
			}
746 752

  
......
1152 1158
		if (!$foreignUid || !t3lib_div::testInt($foreignUid) || $config['foreign_selector']) {
1153 1159
			$record = $this->getNewRecord($this->inlineFirstPid, $current['table']);
1154 1160
				// Set language of new child record to the language of the parent record:
1155
			if ($config['localizationMode']=='select') {
1161
			if ($config['behaviour']['localizationMode']=='select') {
1156 1162
				$parentRecord = $this->getRecord(0, $parent['table'], $parent['uid']);
1157 1163
				$parentLanguageField = $GLOBALS['TCA'][$parent['table']]['ctrl']['languageField'];
1158 1164
				$childLanguageField = $GLOBALS['TCA'][$current['table']]['ctrl']['languageField'];
1159
				if ($parentRecord[$languageField]>0) {
1160
					$record[$childLanguageField] = $parentRecord[$languageField];
1165
				if ($parentRecord[$parentLanguageField]>0) {
1166
					$record[$childLanguageField] = $parentRecord[$parentLanguageField];
1161 1167
				}
1162 1168
			}
1163 1169