[BUGFIX] sys_file record doesn't get flagged as delete 25/22025/2
authorFrans Saris <franssaris@gmail.com>
Wed, 22 May 2013 18:36:31 +0000 (20:36 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Sat, 6 Jul 2013 15:17:31 +0000 (17:17 +0200)
File is deleted by driver and deleted property of FileObject is set by
ResourceStorage but new state is not persisted.

Update deleted property in updateProperties array in FileObject and
persist change.

Fixes: #48336
Releases: 6.2, 6.1, 6.0
Change-Id: I6cac106dcf89125e0b98b8b12a03c0b3f56d484f
Reviewed-on: https://review.typo3.org/22025
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/core/Classes/Resource/AbstractFile.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index a73e720..f5fe790 100644 (file)
@@ -431,6 +431,7 @@ abstract class AbstractFile implements FileInterface {
         */
        public function setDeleted() {
                $this->deleted = TRUE;
+               $this->updateProperties(array('deleted' => TRUE));
        }
 
        /**
@@ -544,4 +545,4 @@ abstract class AbstractFile implements FileInterface {
 }
 
 
-?>
\ No newline at end of file
+?>
index cd15440..29ec2b4 100644 (file)
@@ -997,6 +997,7 @@ class ResourceStorage {
                }
                // Mark the file object as deleted
                $fileObject->setDeleted();
+               $this->getFileRepository()->update($fileObject);
 
                $this->emitPostFileDeleteSignal($fileObject);