Project

General

Profile

Actions

Bug #94119

closed

Ghost record for field with mm relation when relation record is disabled

Added by Chris Müller over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Extbase
Target version:
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:

Ghost record dump

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

ghostrecord.png (84 KB) ghostrecord.png Ghost record dump Chris Müller, 2021-05-12 08:36

Related issues 3 (1 open2 closed)

Related to TYPO3 Core - Bug #88919: QueryBuilder with DefaultRestrictionContainer effectivly transforms outer joins to inner joins because the restrictions are applied to all join tables unconditionallyClosed2019-08-05

Actions
Related to TYPO3 Core - Bug #91324: Visibility restrictions are added twice for Extbase ObjectStorage relationsNew2020-05-06

Actions
Has duplicate TYPO3 Core - Bug #94141: Hidden records are taken into account in m:n relations but instantiated as empty objects Closed2021-05-14

Actions
Actions #1

Updated by Chris Müller over 3 years ago

  • Has duplicate Bug #94141: Hidden records are taken into account in m:n relations but instantiated as empty objects added
Actions #2

Updated by Chris Müller over 3 years ago

  • Subject changed from Ghost record for field with bidirectional mm relation when relation record is disabled to Ghost record for field with mm relation when relation record is disabled
  • Description updated (diff)
Actions #3

Updated by Markus Klein over 3 years ago

  • Related to Bug #88919: QueryBuilder with DefaultRestrictionContainer effectivly transforms outer joins to inner joins because the restrictions are applied to all join tables unconditionally added
Actions #4

Updated by Markus Klein over 3 years ago

  • Status changed from New to Accepted
  • Assignee set to Markus Klein
  • Priority changed from Should have to Must have
  • Target version set to next-patchlevel
  • Complexity set to medium

Confirmed. Albeit this is actually the proof that the leftJoins where broken formerly and that even Extbase had dirty workarounds in place.

Actions #5

Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69177

Actions #6

Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69177

Actions #7

Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69177

Actions #8

Updated by Gerrit Code Review over 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69177

Actions #9

Updated by Gerrit Code Review over 3 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69177

Actions #10

Updated by Markus Klein over 3 years ago

  • Related to Bug #91324: Visibility restrictions are added twice for Extbase ObjectStorage relations added
Actions #11

Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69198

Actions #12

Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69199

Actions #13

Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69199

Actions #14

Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69199

Actions #15

Updated by Markus Klein over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #16

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF