From ae48f4ba52799d64c1072a6b71b89f5f4c055ebc Mon Sep 17 00:00:00 2001 From: Armin Pleisch Date: Thu, 3 Oct 2024 10:10:11 +0200 Subject: [PATCH 1/4] 10.6 Fix recursive restore from recycle bin by adding missing save argument --- models/Element/Recyclebin/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { From a9e1c56591c572476f2df43197afaabe8c34ab8c Mon Sep 17 00:00:00 2001 From: Armin Pleisch Date: Mon, 7 Oct 2024 08:40:24 +0200 Subject: [PATCH 2/4] 10.6 Fix restore assets from recycle bin --- models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From 87a685cc122fb70599081cf57a4647c677f7e328 Mon Sep 17 00:00:00 2001 From: Armin Pleisch Date: Mon, 7 Oct 2024 10:26:03 +0200 Subject: [PATCH 3/4] 10.6 Fix restore assets from recycle bin --- models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/Asset.php b/models/Asset.php index d9847f58dc9..62cabe515f2 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 && $dbPath !== $path && $storage->fileExists($dbPath)) { + if ($dbPath !== $path && $storage->fileExists($dbPath)) { $storage->delete($dbPath); } From fef3dcc060fa701926c50b37dab01e884bd98e46 Mon Sep 17 00:00:00 2001 From: Armin Pleisch Date: Mon, 7 Oct 2024 10:37:50 +0200 Subject: [PATCH 4/4] 10.6 Fix restore assets from recycle bin --- models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }