Project

General

Profile

Bug #94119

Updated by Chris Müller over 3 years ago

Since the update from TYPO3 10.4.15 to 10.4.16 I have "ghost" records with uid=0 and pid=0 in a "related" field when referenced records are disabled. 

 The TCA configuration: 

 <pre> 
 'related' => [ 
     'label' => 'Related', 
     'config' => [ 
         'type' => 'select', 
         'renderType' => 'selectMultipleSideBySide', 
         'foreign_table' => 'tx_video_domain_model_video', 
         'foreign_table_where' => ' AND tx_video_domain_model_video.pid = ###REC_FIELD_pid### AND tx_video_domain_model_video.uid != ###THIS_UID### ORDER BY title', 
         'MM' => 'tx_video_domain_model_videos_related_mm', 
         'MM_opposite_field' => 'related_from', 
         'size' => 5, 
         'minitems' => 0, 
         'maxitems' => 100, 
         'behaviour' => [ 
             'allowLanguageSynchronization' => true, 
         ], 
     ], 
 ], 
 'related_from' => [ 
     'label' => 'Related from', 
     'config' => [ 
         'type' => 'group', 
         'internal_type' => 'db', 
         'foreign_table' => 'tx_video_domain_model_video', 
         'allowed' => 'tx_video_domain_model_video', 
         'size' => 5, 
         'maxitems' => 100, 
         'MM' => 'tx_video_domain_model_videos_related_mm', 
         'readOnly' => 1, 
     ], 
 ], 
 </pre> 

 In the domain model the relevant fields are defined as: 

 <pre> 
 /** 
  * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\MyVendor\Video\Domain\Model\Video> 
  */ 
 protected $related; 

 /** 
  * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\MyVendor\Video\Domain\Model\Video> 
  */ 
 protected $relatedFrom; 

 /** 
  * Get related videos 
  * 
  * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\MyVendor\Video\Domain\Model\Video> 
  */ 
 public function getRelated() 
 { 
     return $this->related; 
 } 
 </pre> 

 The getRelated() method returns then this "ghost" record for every related record which is disabled: 

 !ghostrecord.png! 

 Going back to TYPO3 10.4.15 only enabled records are available. 

 Edit: Looks like it is not related to bidirectional fields, just ol' plain relations.

Back