Project

General

Profile

Actions

Bug #90214

closed

TCA maxitems is ignored

Added by Florian Rival almost 5 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Category:
Extbase
Target version:
-
Start date:
2020-01-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Hi,

When setting TCA maxitems to 1 for INLINE relations, and update the record from FE form, maxitems is ignored, many relations are created in sys_file_reference where there should be only one.

New relation is inserted but old relation is not deleted.

Sample TCA :

    'cv' => [
        'exclude' => false,
        'label' => 'cv',
        'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
            'cv',
            [
                'minitems' => 0,
                'maxitems' => 1,
                'foreign_match_fields' => [
                    'fieldname' => 'cv',
                    'tablenames' => 'fe_users',
                    'table_local' => 'sys_file',
                ]
            ],
            'pdf'
        ),
    ]

And update with :

$this->userRepository->update($user);

The bug appeared in Typo3 9.5.13 but wasn't present in previous V9 versions (don't know exactly which one).

Florian


Files

Bug maxitems.jpg (51.3 KB) Bug maxitems.jpg Florian Rival, 2020-01-27 12:59
Actions

Also available in: Atom PDF