Skip to content
Snippets Groups Projects
Commit 906c1324 authored by Helmut Hummel's avatar Helmut Hummel Committed by Markus Klein
Browse files

[BUGFIX] Unset file properties after signals are triggered

Unsetting file properties needs to happen AFTER
the storage deleted the file, because the storage emits a signal,
which passes the file object to the slots,
which may need all file properties of the deleted file.

Resolves: #81926
Related: #80359
Releases: master, 8.7, 7.6
Change-Id: Ie8e25b30dd99d1ed2afb8ca7b1cc83797887de98
Reviewed-on: https://review.typo3.org/53553


Reviewed-by: default avatarMatthias Vogel <typo3@kanti.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: default avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
parent 65ba5bbe
Branches
Tags
No related merge requests found
......@@ -439,7 +439,15 @@ abstract class AbstractFile implements FileInterface
public function delete()
{
// The storage will mark this file as deleted
return $this->getStorage()->deleteFile($this);
$wasDeleted = $this->getStorage()->deleteFile($this);
// Unset all properties when deleting the file, as they will be stale anyway
// This needs to happen AFTER the storage deleted the file, because the storage
// emits a signal, which passes the file object to the slots, which may need
// all file properties of the deleted file.
$this->properties = [];
return $wasDeleted;
}
/**
......@@ -448,8 +456,6 @@ abstract class AbstractFile implements FileInterface
*/
public function setDeleted()
{
// Unset all properties when deleting the file, as they will be stale anyway
$this->properties = null;
$this->deleted = true;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment