Bug #88293

impexp: unable to save files in composer mode with var/ outside document root

Added by DANIEL Rémy 9 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Import/Export (T3D)
Target version:
-
Start date:
2019-05-07
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

typo3_impexp_transient.patch View (1.43 KB) DANIEL Rémy, 2019-05-07 14:56


Related issues

Duplicates TYPO3 Core - Bug #88815: Import Export uses FAL for temporary files Closed 2019-07-22

History

#1 Updated by Gerrit Code Review 9 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60714

#2 Updated by Susanne Moog 6 months ago

  • Duplicates Bug #88815: Import Export uses FAL for temporary files added

#3 Updated by Susanne Moog 6 months ago

  • Status changed from Under Review to Closed

Closing as duplicate of #88815

#4 Updated by DANIEL Rémy 6 months ago

@Susan

I found the issue, opened a ticket on forge, created and submitted a patch on gerrit. All that on my work time.
And all this work was just throwed by you and Benni, and my work was tagged as "duplicate".
I don't understand.
Honestly, why should I care about trying to fix bug in the future?

Cheers.

#5 Updated by Susanne Moog 6 months ago

Hey,

I'm sorry this happened. As an explanation: I'm guessing Benni did not see your patch and stumbled upon the same problem which he then subsequently fixed. As that patch was fresh on top of the list and we were close to a release, it got in pretty quickly.

A few days later, when I went through my other open reviews, I found your patch again - I compared it to the one that Benni did (which was already merged at this point) and saw that it fixes the same problem in the same way. At this point the patch was superfluous hence why I closed both patch and issue.

I'm really sorry I did not remember your patch before reviewing Bennis and I don't really have a good solution for it except for better memory powers. You did it the way we want and I still hope that you will keep up trying to fix things in the future.

Also available in: Atom PDF