diff --git a/models/Asset.php b/models/Asset.php index 62cabe515f2..d9847f58dc9 100644 --- a/models/Asset.php +++ b/models/Asset.php @@ -770,7 +770,7 @@ protected function update($params = []) // delete old legacy file if exists $dbPath = $this->getDao()->getCurrentFullPath(); - if ($dbPath !== $path && $storage->fileExists($dbPath)) { + if ($dbPath && $dbPath !== $path && $storage->fileExists($dbPath)) { $storage->delete($dbPath); } diff --git a/models/Element/Recyclebin/Item.php b/models/Element/Recyclebin/Item.php index c4afd8bbbd1..8b723e569ed 100644 --- a/models/Element/Recyclebin/Item.php +++ b/models/Element/Recyclebin/Item.php @@ -306,7 +306,7 @@ protected function doRecursiveRestore(Element\ElementInterface $element) $element->markAllLazyLoadedKeysAsLoaded(); $element->setOmitMandatoryCheck(true); } - $element->save(); + $element->save(['isRecycleBinRestore' => true]); if (method_exists($element, 'getChildren')) { if ($element instanceof DataObject\AbstractObject) {