Bug #90214

TCA maxitems is ignored

Added by Florian Rival 29 days ago. Updated 29 days ago.

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

0%

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

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

History

#1 Updated by Florian Rival 29 days ago

  • Category set to Extbase

Also available in: Atom PDF