Bug #48336
closedsys_file record doesn't get flagged as delete after deleting a file
0%
Description
When you delete a file (in BE filelist module) the deleted field in sys_file record doesn't get updated to 1
Updated by Frans Saris over 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);
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Frans Saris over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 66e08fe0d978ee6ca6ce1c965ae99678a4f0c88b.
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Christian Kuhn over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset 31b29c0418f88fdeb5eea6e0236b5763b4d10598.
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Steffen Ritter over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset 18bb6574966d6fdff944e8fd5f95e9225dae4365.
Updated by Gerrit Code Review over 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
Updated by Steffen Ritter over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset f45af2ceed02c849c30715892582b68e6aff5e5a.
Updated by Oliver Hader over 11 years ago
Reverted in all branches due to regressions!
Updated by Chris topher over 11 years ago
- Status changed from Resolved to New
- % Done changed from 100 to 0
Updated by Ernesto Baschny about 11 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?
Updated by Ernesto Baschny about 11 years ago
- Status changed from Needs Feedback to Rejected
- Is Regression set to No