Bug #65859

Updated by Peter Niederlag about 9 years ago

h2. Intro 

 Currently extbase lacks support for l10n_mode. 

 See #62921 for a lengthy discussion of the background. From my point of view support for l10n_mode must explicitly be enabled/added in extbase, that's why I duplicated #62921 here. 

 h2. Use Case 

 As Developer I want to be able to assign a relation on a record in the default translation that must not be changed in the translation of the record. 
 When I set l10n_mode=exclude in $TCA 
 When I use the \TYPO3\CMS\Extbase\Persistence\QueryInterface to lookup records by a category 
 Then I expect to find translated records in the Frontend 

 'faculty' => array( 
			 'exclude' => 0, 
			 'l10n_mode' => 'exclude', 
			 'l10n_display' => 'hideDiff,defaultAsReadonly', 
			 'label' => 'LLL:EXT:luhjobs/Resources/Private/Language/locallang_db.xlf:tx_luhjobs_domain_model_vacancy.faculty', 
			 'config' => array( 
				 'type' => 'select', 
				 'foreign_table' => 'tx_luhjobs_domain_model_faculty', 
				 'foreign_table_where' => 'AND tx_luhjobs_domain_model_faculty.sys_language_uid IN (-1,0)', 
				 'items' => array( 
				 'minitems' => 1, 
				 'maxitems' => 1, 

 // QueryInterface 
 $constraints[] = $query->equals('faculty', $uid); 

 // resulting SQL(relevant parts only) in case of Frontend with ?L=1 
 tx_luhjobs_domain_model_vacancy.type = '19' AND tx_luhjobs_domain_model_vacancy.intern = 0 
	 tx_luhjobs_domain_model_vacancy.sys_language_uid IN (1,-1) 
		 tx_luhjobs_domain_model_vacancy.sys_language_uid=0 AND tx_luhjobs_domain_model_vacancy.uid NOT IN 
				 SELECT tx_luhjobs_domain_model_vacancy.l10n_parent FROM tx_luhjobs_domain_model_vacancy WHERE tx_luhjobs_domain_model_vacancy.l10n_parent>0 AND tx_luhjobs_domain_model_vacancy.sys_language_uid=1 AND tx_luhjobs_domain_model_vacancy.deleted=0 

 This does miss the translated records as they have faculty=0 due to the l10n_mode=exclude setting in $TCA