Bug #45109
closedEditing the file content of a file marked as deleted result in exception
0%
Description
If you set deleted=1 for a file in sys_file, then open the file for local editing, you cannot save the file any more:
First of all, files should not exist on the local file system and at the same time keep their deleted flag in DB.
Second, even if they are listed, you should not be able to edit them.
Third, the deleted flag should be reset if you save the file, because you do want them to exist.
Uncaught TYPO3 Exception #1317178604: No file found for given UID. (More information) InvalidArgumentException thrown in file /home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Resource/ResourceFactory.php in line 262. 6 TYPO3\CMS\Core\Resource\ResourceFactory::getFileObject("13") /home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Resource/ResourceFactory.php: 00315: return $this->retrieveFileOrFolderObject($input); 00316: } elseif (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($input)) { 00317: return $this->getFileObject($input); 00318: } elseif (strpos($input, ':') > 0) { 00319: list($prefix, $folderIdentifier) = explode(':', $input); 5 TYPO3\CMS\Core\Resource\ResourceFactory::retrieveFileOrFolderObject("13") /home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php: 00442: */ 00443: protected function getFileObject($identifier) { 00444: $object = $this->fileFactory->retrieveFileOrFolderObject($identifier); 00445: if (!is_object($object)) { 00446: throw new \TYPO3\CMS\Core\Resource\Exception\InvalidFileException('The item ' . $identifier . ' was not a file or directory!!', 1320122453); 4 TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::getFileObject("13") /home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php: 00742: // for backwards compatibility: the combined file identifier was the path+filename 00743: $fileIdentifier = $cmds['target']; 00744: $fileObject = $this->getFileObject($fileIdentifier); 00745: // Example indentifier for $cmds['target'] => "2:targetpath/targetfolder/" 00746: $content = $cmds['data']; 3 TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::func_edit(array) /home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php: 00255: break; 00256: case 'editfile': 00257: $result[$action][] = $this->func_edit($cmdArr); 00258: break; 00259: case 'upload': 2 TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::processData() /home/phil/t3-playground/t3-git/typo3/sysext/backend/Classes/Controller/File/FileController.php: 00128: } else { 00129: $this->fileProcessor->start($this->file); 00130: $this->fileData = $this->fileProcessor->processData(); 00131: } 00132: } 1 TYPO3\CMS\Backend\Controller\File\FileController::main() /home/phil/t3-playground/t3-git/typo3/tce_file.php: 00040: $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\FileController'); 00041: $SOBE->init(); 00042: $SOBE->main(); 00043: $SOBE->finish(); 00044: ?>
Updated by Andreas Wolf almost 12 years ago
IMHO this is mainly a UI bug. Editing a file should be forbidden when it is deleted, which has to be checked by the file edit module.
I'd like to split this into several issues, as we tackle totally different problems here.
Updated by Philipp Gampe almost 12 years ago
The UI has changed already so you can focus on fixing the code on unexpected conditions.
#45130 looks like it will solve most of this.
Updated by Chris topher about 11 years ago
- Status changed from New to Needs Feedback
- Is Regression set to No
The deleted flag has been removed in master, 6.1.5 and 6.0.10.
Does this fix the issue?
Updated by Steffen Ritter about 11 years ago
- Status changed from Needs Feedback to Accepted
Updated by Steffen Ritter about 11 years ago
- Status changed from Accepted to On Hold
Updated by Mathias Schreiber almost 10 years ago
- Status changed from On Hold to Closed