Project

General

Profile

Bug #80699

Updated by Thomas Hohn over 7 years ago

We have a BackendPage with some in-line elements and in the inline elements there is foreign TCA relation to another table.  

 When we create a new element (before saving it) we would like to be able to display the existing relations - but the 
 UID of the new inline-element is NEWxxxxxxx making it impossible to use AND questions_uid=###REC_FIELD_questions_uid### 
 in the foreign_table_where. This used to be the case in previous versions of TYPO3. 

 This could be solved by using the marker @###THIS_UID###@ - however this has the value NEWxxxx since the record has not 
 yet been saved. Instead the method @processForeignTableClause@ in @TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider@ 
 should be modified to take the fact: 
 # The uid contains NEW 
 # It's an isInlineChild 
 # The isInlineChildExpanded is expanded 
 and the use the @$result['inlineParentUid']@ instead of @(int)$result['databaseRow']['uid'];@ like in the 
 following pseudo code. 
 @ 
 if ((strpos($result['databaseRow']['uid'], 'NEW') !== false)  
     && $result['isInlineChild'] === 1 
     && $result['isInlineChildExpanded'] === 1) { 
     $uid = $result['inlineParentUid'] 
 } else { 
	 $uid = (int)$result['databaseRow']['uid']; 
 }@ TYPO3

Back