Project

General

Profile

Actions

Bug #45109

closed

Editing the file content of a file marked as deleted result in exception

Added by Philipp Gampe almost 12 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2013-02-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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: ?>

Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Bug #44581: Editing file properties and pushing the delete button in docheader leads to exceptionClosed2013-01-16

Actions
Related to TYPO3 Core - Bug #42294: Missing action button to delete a fileRejected2012-10-23

Actions
Related to TYPO3 Core - Bug #45110: File is listed twice in sys_fileClosed2013-02-03

Actions
Related to TYPO3 Core - Bug #50575: Fatal error while adding files to tt_contentClosed2013-07-30

Actions
Blocked by TYPO3 Core - Task #45130: Reset deleted flag for existing filesClosed2013-02-04

Actions
Actions #1

Updated by Max Roesch almost 12 years ago

I can confirm this behaviour in 6.0.1

Actions #2

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.

Actions #3

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.

Actions #4

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?

Actions #5

Updated by Steffen Ritter about 11 years ago

  • Status changed from Needs Feedback to Accepted
Actions #6

Updated by Steffen Ritter about 11 years ago

  • Status changed from Accepted to On Hold
Actions #7

Updated by Mathias Schreiber almost 10 years ago

  • Status changed from On Hold to Closed
Actions

Also available in: Atom PDF