Bug #88293
closedimpexp: unable to save files in composer mode with var/ outside document root
0%
Description
With TYPO3 9.5 in composer mode with var/ outside document root,
I am unable to export a T3D with files in extra folder.
During the export, the files are written in the transient directory,
and then copied to the final destination, beside t3d file.
(see \TYPO3\CMS\Impexp\Controller\ImportExportController::exportData()
in the if ($inData['save_export'])
This copy process uses the FAL api to get the list of files in the transient directory and to move them into the targe folder: ResourceStorage->getFolder()
, Folder->getFiles()
and ResourceStorage->moveFile()
.
But: the FAL api can not handle files/directories outside the public directory,
and this lead to an exception "Folder does not exist"
Step to reproduce
- Have a TYPO3 9.5 instance in composer mode with var/ outside document root
- Start an export of a pagetree with impexp module
- Check "Save files in extra folder beside the export file"
- Start the export by clicking "Save to filename"
- You must see an exception like Folder "/var/www/html/var/transient/export_temp_files_8084122268506555113" does not exist
.
How to fix it?
IMHO impexp should not use FAL api for manipulating transient files.
GeneralUtility::getFilesInDir() and GeneralUtility::upload_copy_move() should be used instead.
Patch attached.
Files