Issue Bug Closed

#107556Relation of StaticSelectFieldType is not set correctly in ColumnMapFactory

Gernot Leitgab 09/28/25, 07:42 updated 12/02/25, 13:04

Description

If a field is configured as a static many-to-many relation in TCA, TYPO3 13 no longer handles it correctly in the method \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMapFactory::setRelations(). As a result, typeOfRelation is marked as Relation::NONE instead of Relation::HAS_MANY. This leads to the following error in \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseComparison():
“Unsupported or non-existing property name “location” used in relation matching.”

Steps to reproduce:

1. Define a TCA field with a static select (many-to-many) configuration:

        'location' => [
            'exclude' => 1,
            'label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_db.xlf:fe_users.location',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'items' => [
                    ['label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_db.xlf:fe_users.location.I.1', 'value' => 1],
                    ['label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_db.xlf:fe_users.location.I.2', 'value' => 2],
                ],
                'maxitems' => 2,
            ],
        ],

Execute a query in an Extbase repository using contains():

$constraints[] = $query->contains('location', (int)$location);

Reviews 2

History 712

  1. Oliver Bartsch commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2025-09-30T09:02:38+00:00" > 09/30/25, 09:02 </span>

    Hi, thanks for your report.

    Could you please also provide the corresponding extbase model. This also influences the column mapping.

    Thanks and all the best,
    Oli

  2. Gerrit Code Review pushed patch set 1 for main to change 90844 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2025-09-30T09:31:00+00:00" > 09/30/25, 09:31 </span>

  3. Oliver Bartsch commented <span data-processor="relativetime" data-value="2025-10-01T07:39:08+00:00" > 10/01/25, 07:39 </span>

    Hi Gernot,

    we have applied a patch for v13, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/90845. Please have a look, whether this fixes your problem. Otherwise, as said in my other comment, it would be really valuable if you could provide the corresponding extbase model.

    Best,
    Oli

  4. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-10-01T07:40:10+00:00" > 10/01/25, 07:40 </span>

    Applied in changeset commit:06d3e07d1c28305440c02cbafe01de391d6f9275.

  5. Gernot Leitgab commented <span data-processor="relativetime" data-value="2025-10-01T08:36:09+00:00" > 10/01/25, 08:36 </span>

    Oliver Bartsch wrote in #note-1:
    > Hi, thanks for your report.
    >
    > Could you please also provide the corresponding extbase model. This also influences the column mapping.
    >
    > Thanks and all the best,
    > Oli

    The following model is used:

        protected string $location = '';
    
        public function setLocation(string $location): void
        {
            $this->location = $location;
        }
    
        public function getLocation(): string
        {
            return $this->location;
        }
    
        public function setLocationArray(array $locationArray): void
        {
            $this->location = implode(',', $locationArray);
        }
    
        public function getLocationArray(): array
        {
            return GeneralUtility::intExplode(',', $this->location, true);
        }
  6. Gernot Leitgab commented <span data-processor="relativetime" data-value="2025-10-01T08:38:10+00:00" > 10/01/25, 08:38 </span>

    Oliver Bartsch wrote in #note-8:
    > Hi Gernot,
    >
    > we have applied a patch for v13, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/90845. Please have a look, whether this fixes your problem. Otherwise, as said in my other comment, it would be really valuable if you could provide the corresponding extbase model.
    >
    > Best,
    > Oli

    Thank you for providing a patch for v13!

    With your patch applied the above mentioned error is gone and the repository returns the appropriate objects.