Skip to content

Commit

Permalink
10.6 Fix restore assets from recycle bin
Browse files Browse the repository at this point in the history
10.6 Fix recursive restore from recycle bin by adding missing save argument
  • Loading branch information
mugge6 committed Oct 7, 2024
1 parent dd81ef4 commit 0b4fe6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion models/Element/Recyclebin/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0b4fe6b

Please sign in to comment.