[BUGFIX] Unset internal properties of processed file on delete 05/53505/4
authorHelmut Hummel <typo3@helhum.io>
Mon, 20 Mar 2017 18:28:12 +0000 (19:28 +0100)
committerHelmut Hummel <typo3@helhum.io>
Tue, 6 Mar 2018 10:01:35 +0000 (11:01 +0100)
When a processed file is deleted because it needs reprocessing, set the
internal deleted property to true and unset its properties as well, as
they are stale anyway.

This is important as in the later processing it is checked whether the
current object is persisted (which it is not anymore) and an SQL update
is triggered, which then fails leading to another processing run in
subsequent requests.

When unsetting the internal properties a new row will be inserted
in the same request.

Resolves: #80359
Releases: 7.6, 8.7, master
Change-Id: I39eec59ed4ac071883ff97eab7018d1ede92fb95
Reviewed-on: https://review.typo3.org/53505
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index b292a51..ae857cc 100644 (file)
@@ -1727,7 +1727,7 @@ class ResourceStorage implements ResourceStorageInterface
             }
         }
         // Mark the file object as deleted
-        if ($fileObject instanceof File) {
+        if ($fileObject instanceof AbstractFile) {
             $fileObject->setDeleted();
         }