[BUGFIX] Do not try to delete already remove file 86/59186/2
authorHelmut Hummel <typo3@helhum.io>
Mon, 17 Dec 2018 21:33:23 +0000 (22:33 +0100)
committerBenni Mack <benni@typo3.org>
Tue, 18 Dec 2018 06:49:54 +0000 (07:49 +0100)
When using the FAL API to add a file to a folder,
the local file is deleted by default already.

Thus the attempt to remove the file again results in a warning.

Therefore remove the obsolete unlink to avoid the warning.

Resolves: #87192
Releases: 8.7, 9.5, master
Change-Id: I23f3192e2760cd705429337464c8a5506cf41205
Reviewed-on: https://review.typo3.org/59186
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>

index 7409a86..ac3da0c 100644 (file)
@@ -112,7 +112,6 @@ abstract class AbstractOnlineMediaHelper implements OnlineMediaHelperInterface
         $temporaryFile = GeneralUtility::tempnam('online_media');
         GeneralUtility::writeFileToTypo3tempDir($temporaryFile, $onlineMediaId);
         $file = $targetFolder->addFile($temporaryFile, $fileName, DuplicationBehavior::RENAME);
-        GeneralUtility::unlink_tempfile($temporaryFile);
         return $file;