From 4194e1fb59c063aeaf00048e902aaf2e86862170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Tue, 17 Mar 2026 15:07:10 +0100 Subject: [PATCH] fix: catch new type error being thrown This is a new error that is thrown due to the update to php 8.3 --- apps/files_trashbin/lib/Storage.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php index 5012ce320655..e1fe017d119e 100644 --- a/apps/files_trashbin/lib/Storage.php +++ b/apps/files_trashbin/lib/Storage.php @@ -230,7 +230,17 @@ public function retainKeys($filename, $owner, $ownerPath, $timestamp, $sourceSto if ($sourceStorage !== null) { $sourcePath = '/' . $owner . '/files_trashbin/files/'. $filename . '.d' . $timestamp; $targetPath = '/' . $owner . '/files/' . $ownerPath; - return $sourceStorage->copyKeys($sourcePath, $targetPath); + try { + return $sourceStorage->copyKeys($sourcePath, $targetPath); + } catch (\TypeError $e) { + // FIXME: The copyKeys method isn't fully implemented in all the storages / wrappers. + // The call will likely trigger this error if the OC\Files\Storage\Wrapper\Encryption + // isn't part if the wrappers in the $sourceStorage. + // In PHP 7.4, this error was ignored and logged, but in PHP 8.3 it throws an + // exception that breaks the code execution. + // For the short term, we'll keep the previous behavior and catch the exception here. + return false; + } } } return false;