[BUGFIX] Delete FAL records + relations in ResourceStorage::deleteFolder() 51/39951/2
authorFrans Saris <franssaris@gmail.com>
Thu, 4 Jun 2015 15:08:50 +0000 (17:08 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 5 Jun 2015 06:55:24 +0000 (08:55 +0200)
When deleting a folder (recursive) also delete all FAL records and
relations to keep the FAL index up-to-date.

Resolves: #67084
Releases: master, 6.2
Change-Id: Ic3ae51a568ad43e6283e3900da24796656c9347c
Reviewed-on: http://review.typo3.org/39951
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 9f50429..9f467d6 100644 (file)
@@ -1961,6 +1961,10 @@ class ResourceStorage implements ResourceStorageInterface {
 
                $this->emitPreFolderDeleteSignal($folderObject);
 
+               foreach ($this->getFilesInFolder($folderObject, 0, 0, FALSE, $deleteRecursively) as $file) {
+                       $this->deleteFile($file);
+               }
+
                $result = $this->driver->deleteFolder($folderObject->getIdentifier(), $deleteRecursively);
 
                $this->emitPostFolderDeleteSignal($folderObject);