[BUGFIX] sys_file record doesn't get flagged as delete 82/20982/4
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:12:10 +0000 (17:12 +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/20982
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/core/Classes/Resource/AbstractFile.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 48217d4..39c6e5b 100644 (file)
@@ -448,6 +448,7 @@ abstract class AbstractFile implements FileInterface {
         */
        public function setDeleted() {
                $this->deleted = TRUE;
+               $this->updateProperties(array('deleted' => TRUE));
        }
 
        /**
index 4b7d636..15582d6 100644 (file)
@@ -999,6 +999,7 @@ class ResourceStorage {
                }
                // Mark the file object as deleted
                $fileObject->setDeleted();
+               $this->getFileRepository()->update($fileObject);
 
                $this->emitPostFileDeleteSignal($fileObject);