Project

General

Profile

Bug #80699

Updated by Thomas Hohn about 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 
 ###REC_FIELD_questions_uid### of the new inline-element is empty 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. 

 The problem seems to be in the processing of ###REC_FIELD_field_name### where an extra condition could be added in case that the 
 ###REC_FIELD_field_name### matches the [inlineParentConfig][foreign_field] it could be assigned the value from $result['inlineParentUid'] 
 which is present at that time. 

 Use-case: 

 Matching of source and targets elements on a BE form. 
 User typically creates a number of targets on the form which are store in tx_systimequizmatching_targets. 
 Now the user want's to create relations between sources and targets by creating a source element in the 
 same form.  
 Before the patch the ###REC_FIELD_questions_uid### can't be resolved before the form has been saved - which makes it cumbersome 
 to create a lot of relations since it requires "create source element", "save" , "go to element again", "create relations" and 
 "save". 

 The prober way (used to be so in previous versions of TYPO3) was create source element, add relation and save (faster). 

 Involved tables: 
 <pre> 
 Table tx_systimequizmatching_sources (sources) 
 Table tx_systimequizmatching_targets (targets) 
 Table tx_systimequizmatching_sources_targets_mm (MM table) 
 </pre> 

 TCA for part of tx_systimequizmatching_sources is 
 <pre> 
  'targets' => array( 
             'exclude' => 0, 
             'label' => 'LLL:EXT:systime_quiz_matching/Resources/Private/Language/locallang_db.xlf:tx_systimequizmatching_sources.targets', 
             'config' => array( 
                 'type' => 'select', 
                 'renderType' => 'selectCheckBox', 
                 'disableNoMatchingValueElement' => 1, 
                 'foreign_table' => 'tx_systimequizmatching_targets', 
                 'foreign_table_where' => 'AND questions_uid=###REC_FIELD_questions_uid### AND questions_uid > 0 ORDER BY tx_systimequizmatching_targets.sorting', 
                 'size' => 10, 
                 'minitems' => 0, 
                 'maxitems' => 10, 
                 'MM' => 'tx_systimequizmatching_sources_targets_mm', 
                 'renderMode' => 'checkbox', 
             ) 
         ), 
 </pre> 

Back