Bug #90373
closedPersisting FileReference in Extbase leads to empty 'table_local' field in sys_file_reference
0%
Description
Persisting a new TYPO3\CMS\Extbase\Domain\Model\FileReference in an Extbase Model does not set the value 'sys_file' in the sys_file_reference record.
In the backend this has the effect that the reference is not recognized as file. An editor does not see the original image for example when opening the info-view to the reference. When the field 'table_local' is empty, the info-view shows a 'file reference' and does not show the original image and information to it, it only shows information about the reference itself. When the field 'table_local' contains the value 'sys_file' as it should, the editor sees information to the orignial file.
I don't know how the model is handled internally when persisting, as there is no field uidForeign in the model (and also not in one of it's ancestor classes), and also no field tableLocal, i guess some magic is done do it on persisting.
However, the field 'table_local' must contain a value after persisting.
Files
Updated by Christian Eßl over 4 years ago
- Related to Feature #90374: Add setOriginaFile / setFile setter to TYPO3\CMS\Extbase\Domain\Model\FileReference added
Updated by André Buchmann almost 4 years ago
This issue is also caused if the default value for the field table_local is somehow missing in the TCA.
Here you can see the difference between the correct entry (first image) and the entry with empty table_local field (second image)
Updated by Stefan Froemken about 1 year ago
- File Bildschirmfoto 2023-06-24 um 12.23.31.png Bildschirmfoto 2023-06-24 um 12.23.31.png added
- Status changed from New to Closed
Hello and thank you for that info.
I have just tested that issue on TYPO3 12 again without any problems.
With TYPO3 12.0 we have remove the usage of table_local completely.
As you see in my uploaded image here, all data of sys_file will be shown in FileInfo PopUp now.
I will close the ticket now. If you feel this is the wrong decision, let me know, and I will re-open it.
Stefan