Issue Bug Closed

#83308Allowed memory size exhausted when editing file meta data

Markus Poerschke 12/13/17, 12:18 updated 12/16/17, 18:10

Description

We have ca. 220k sys_files records. When editing the meta data (sys_file_metadata) we get the following error message:

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/typo3/cms/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php on line 1199

The problem is the file field in the sys_file_metadata. All available 220k files are loaded as possible items for that field. But the definition of file defines it as a “readOnly” field. Therefore only the current selection should be loaded.

I am not sure where exactly this bug needs to be fixed.

For us adding a typo3conf/ext/site_xxx/Configuration/TCA/Overrides/sys_file_metadata.php file with the following content solved the issue for us:

$GLOBALS['TCA']['sys_file_metadata']['columns']['file']['config']['foreign_table_where'] = 'AND sys_file.uid = ###REC_FIELD_file###';

I think either this should be added to the original TCA configuration or \TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::addData needs to be changed in a way that only the current record is loaded when the select field is defined as “readOnly”.

We are using TYPO3 v7 LTS. I do not know currently if the bug also exists in newer TYPO3 versions.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.