From a32937473ff9d1f75cb8ff9b4237eaca4ef98649 Mon Sep 17 00:00:00 2001 From: Michael Krecek Date: Wed, 3 Jul 2024 12:33:33 +0200 Subject: [PATCH] Check existing location tokens on unconditioned model --- src/Model/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/File.php b/src/Model/File.php index dfaf7e1..753c2d4 100644 --- a/src/Model/File.php +++ b/src/Model/File.php @@ -108,7 +108,7 @@ protected function init(): void $this->onHookShort(Model::HOOK_AFTER_DELETE, function () { $path = $this->get('location'); if ($path && $this->flysystem->fileExists($path)) { - $files = (clone $this->getModel())->addCondition( + $files = (new self($this->getModel()->getPersistence()))->addCondition( 'id', '!=', $this->getId()