Project

General

Profile

Actions

Bug #104233

closed

PHP Warning: Undefined array key "minitems" for editors with no permissions to sys_file_reference

Added by Georg Ringer 5 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend User Interface
Start date:
2024-06-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Setting up an editor to allow tt_content but not sys_file_references leads to a strange error

PHP Warning: Undefined array key "minitems" in /var/www/html/typo3/sysext/backend/Classes/Form/Container/FilesControlContainer.php line 169

Problematic code

 $this->fileReferenceData['config'][$formFieldIdentifier . '-' . self::FILE_REFERENCE_TABLE] = [
            'min' => $config['minitems'],
            'max' => $config['maxitems'],
            'sortable' => $config['appearance']['useSortable'] ?? false,
            'top' => [
                'table' => $top['table'],
                'uid' => $top['uid'],
            ],
            'context' => [
                'config' => $configJson,
                'hmac' => $this->hashService->hmac($configJson, 'FilesContext'),
            ],
        ];

The reason is simple: \TYPO3\CMS\Backend\Form\FormDataProvider\TcaFiles does early checks if the user doesn't have access and if not, no default min/max items are initialized

Actions

Also available in: Atom PDF