Actions
Bug #94119
closedGhost record for field with mm relation when relation record is disabled
Start date:
2021-05-12
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:
Description
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:
'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, ], ],
In the domain model the relevant fields are defined as:
/** * @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; }
The getRelated() method returns then this "ghost" record for every related record which is disabled:
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.
Files
Actions