Project

General

Profile

Actions

Bug #48336

closed

sys_file record doesn't get flagged as delete after deleting a file

Added by Frans Saris almost 11 years ago. Updated over 10 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2013-05-17
Due date:
% Done:

0%

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

Description

When you delete a file (in BE filelist module) the deleted field in sys_file record doesn't get updated to 1


Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Feature #48182: File-Indexer doesn't flag missing files as deletedClosed2013-05-14

Actions
Related to TYPO3 Core - Bug #50363: Fatal error: Call to undefined method TYPO3\CMS\Core\Resource\ProcessedFile::getUpdatedProperties()Rejected2013-07-24

Actions
Related to TYPO3 Core - Bug #50508: Re-uploading file in backend failsClosed2013-07-29

Actions
Related to TYPO3 Core - Bug #50531: Deleted state is not persisted in file objectsClosed2013-07-29

Actions
Related to TYPO3 Core - Task #50876: Handling of deleted files in FALClosed2013-08-06

Actions
Actions #1

Updated by Frans Saris almost 11 years ago

Did just some debugging and found out that $fileObject->deleted is set to TRUE. But the change isn't persisted.

The following 2 changes fixes this.

In \TYPO3\CMS\Core\Resource\ResourceStorage::deleteFile() add:


        // Mark the file object as deleted
        $fileObject->setDeleted();
        $this->updateFile($fileObject);

and change \TYPO3\CMS\Core\Resource\ResourceStorage::updateFile() to:

    protected function updateFile(AbstractFile $file, $identifier = '', $storage = NULL) {
        if ($identifier === '') {
            $identifier = $file->getIdentifier();
        }
        if($file->isDeleted()) {
            $newProperties = array('deleted' => 1);
        } else {
            $fileInfo = $this->driver->getFileInfoByIdentifier($identifier);
            // TODO extend mapping
            $newProperties = array(
                'storage' => $fileInfo['storage'],
                'identifier' => $fileInfo['identifier'],
                'tstamp' => $fileInfo['mtime'],
                'crdate' => $fileInfo['ctime'],
                'mime_type' => $fileInfo['mimetype'],
                'size' => $fileInfo['size'],
                'name' => $fileInfo['name']
            );
        }
        if ($storage !== NULL) {
            $newProperties['storage'] = $storage->getUid();
        }
        $file->updateProperties($newProperties);
        $this->getFileRepository()->update($file);
    }

The last change isn't that nice. would be better the driver returns info about the fact the file is deleted/missing. But at the moment the driver throws an excpetion. Maybe a try...chatch and in the catch set to $newProperties to deleted?

Or only

In \TYPO3\CMS\Core\Resource\ResourceStorage::deleteFile() add:


        // Mark the file object as deleted
        $fileObject->setDeleted();
        $fileObject->updateProperties(array('deleted' => 1));
        $this->getFileRepository()->update($fileObject);

Actions #2

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20982

Actions #3

Updated by Gerrit Code Review almost 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20982

Actions #4

Updated by Gerrit Code Review almost 11 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20982

Actions #5

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22024

Actions #6

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22025

Actions #7

Updated by Frans Saris almost 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22034

Actions #9

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22037

Actions #10

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22038

Actions #11

Updated by Christian Kuhn almost 11 years ago

  • Status changed from Under Review to Resolved
Actions #12

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22056

Actions #13

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22060

Actions #14

Updated by Steffen Ritter almost 11 years ago

  • Status changed from Under Review to Resolved
Actions #15

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22064

Actions #16

Updated by Steffen Ritter almost 11 years ago

  • Status changed from Under Review to Resolved
Actions #17

Updated by Oliver Hader over 10 years ago

Reverted in all branches due to regressions!

Actions #18

Updated by Chris topher over 10 years ago

  • Status changed from Resolved to New
  • % Done changed from 100 to 0
Actions #19

Updated by Ernesto Baschny over 10 years ago

  • Status changed from New to Needs Feedback
  • Target version set to 6.2.0
  • TYPO3 Version changed from 6.1 to 6.2

Frans, we now have the "missing" flag which is more semantically correct. The "deleted" flag should be dropped as decided in Mainz (#51562). So this issue here is now also obsolete, right?

Actions #20

Updated by Frans Saris over 10 years ago

Yes this issue is obsolete now.

Actions #21

Updated by Ernesto Baschny over 10 years ago

  • Status changed from Needs Feedback to Rejected
  • Is Regression set to No
Actions

Also available in: Atom PDF