Feature #62830
closedEpic #83669: Improve file list / file browser
Improved folder moving/copying
Added by Christian Opitz about 10 years ago. Updated about 1 year ago.
0%
Description
TYPO3\CMS\Core\Resource\ResourceStorage
require several improvements:
- Implement moving and copying folders between storages
- Implement conflict handling for moving and copying folders
- renameNewFolder would generate another name for the target folder, when it already exists at target parent
- renameNewFile would add new directories and add the files with new names, when they already exist
- integrate would add new directories and overwrite existing files
- cancel would cancel
- Implement a way to allow custom drivers to import files from other drivers/storages rather than forcing it to add a local copy (see thread on mailing list for upfront discussions):
Will provide anTYPO3\CMS\Core\Resource\Driver\ImportableDriverInterface
withimportFile(\TYPO3\CMS\Core\Resource\FileInterface $file, $targetFolderIdentifier, $newFileName = null, $removeOriginal = TRUE)
. When the driver implements this interface, this method instead ofaddFile()
will be called in ResourceStorage::moveFile() and ResourceStorage::copyFile() - Allow to moveFile/moveFolder without removing the source file (usefull for migrations between two different drivers)
- Create functional tests for the move and copy methods
Updated by Gerrit Code Review about 10 years 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 http://review.typo3.org/33955
Updated by Gerrit Code Review about 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33955
Updated by Gerrit Code Review about 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33955
Updated by Gerrit Code Review about 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33955
Updated by Gerrit Code Review about 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33955
Updated by Gerrit Code Review about 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33955
Updated by Gerrit Code Review about 10 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33955
Updated by Gerrit Code Review about 10 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33955
Updated by Christian Opitz almost 10 years ago
The most basic ImportableDriver would just call addFile (untested):
<?php
namespace TYPO3\CMS\Core\Resource\Driver;
class LocalImportableDriver extends LocalDriver implements ImportableDriverInterface {
/**
* Add an already existing FAL File from another storage
*
* @param \TYPO3\CMS\Core\Resource\FileInterface $file
* @param string $targetFolderIdentifier
* @param string $newFileName optional, if not given original name is used
* @return string The new identifier
*/
public function importFile(\TYPO3\CMS\Core\Resource\FileInterface $file, $targetFolderIdentifier, $newFileName = NULL) {
return $this->addFile(
$file->getForLocalProcessing(FALSE),
$targetFolderIdentifier,
$newFileName,
FALSE
);
}
}
A more sophisticated one, could download the files from another storage (untested):
<?php
namespace TYPO3\CMS\Core\Resource\Driver;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class LocalImportableDriver extends LocalDriver implements ImportableDriverInterface {
/**
* Change to suit your host
*/
const IMPORT_SOURCE_BASE = 'http://localhost';
/**
* Add an already existing FAL File from another storage
*
* @param \TYPO3\CMS\Core\Resource\FileInterface $file
* @param string $targetFolderIdentifier
* @param string $newFileName optional, if not given original name is used
* @return string The new identifier
*/
public function importFile(\TYPO3\CMS\Core\Resource\FileInterface $file, $targetFolderIdentifier, $newFileName = NULL) {
$newFileName = $this->sanitizeFileName($newFileName ? $newFileName : $file->getName());
$newFileIdentifier = $this->canonicalizeAndCheckFolderIdentifier($targetFolderIdentifier) . $newFileName;
$targetPath = $this->absoluteBasePath . $newFileIdentifier;
$handle = fopen(self::IMPORT_SOURCE_BASE . $file->getPublicUrl(), 'r');
if (!$handle) {
throw new \RuntimeException('Could not open file via URL');
}
if (!file_put_contents($targetPath, $handle) || !file_exists($targetPath)) {
throw new \RuntimeException('Adding file ' . $localFilePath . ' at ' . $newFileIdentifier . ' failed.');
}
clearstatcache();
GeneralUtility::fixPermissions($targetPath);
return $newFileIdentifier;
}
}
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from 7.0 to 7.1 (Cleanup)
Updated by Markus Klein over 9 years ago
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
- Complexity set to medium
- If I move a folder /foo/bla. There must not be a paste sign on the /foo folder. Neither in list-view on the folder / nor in the toolbar when in folder /foo
- If I copy a folder /foo/bla. Then there must be a check if the folder already exists, when I try to paste it into /foo again (edited)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Gerrit Code Review about 8 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Michael Oehlhof about 8 years ago
- Target version changed from 7 LTS to 8 LTS
Updated by Gerrit Code Review about 8 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Gerrit Code Review about 8 years ago
Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/33955
Updated by Riccardo De Contardi over 7 years ago
- Target version changed from 8 LTS to 9.0
Updated by Riccardo De Contardi almost 7 years ago
- Related to Feature #66514: Better UI to move multiple files or folders added
Updated by Susanne Moog almost 7 years ago
- Target version changed from 9.0 to 9.2
Updated by Susanne Moog over 6 years ago
- Target version changed from 9.2 to Candidate for Major Version
Updated by Susanne Moog over 5 years ago
- Status changed from Under Review to Accepted
- Assignee deleted (
Christian Opitz)
Review has been abandoned.
Updated by Christian Kuhn about 1 year ago
- Status changed from Accepted to Closed
Closing here: It seems this issue is totaly stuck and the API had various changes meanwhile. Let's start with a fresh issue if this is still a problem.