diff --git a/src/Domain/Teams/Actions/TransferContentOwnershipToTeamFolderOwnerAction.php b/src/Domain/Teams/Actions/TransferContentOwnershipToTeamFolderOwnerAction.php index 2051a2ad..270512a5 100644 --- a/src/Domain/Teams/Actions/TransferContentOwnershipToTeamFolderOwnerAction.php +++ b/src/Domain/Teams/Actions/TransferContentOwnershipToTeamFolderOwnerAction.php @@ -1,9 +1,8 @@ whereIn('parent_id', $teamFolderIds) ->where('user_id', $leavingUserId) ->cursor() - ->each(fn ($file) => + ->each( + fn ($file) => $this->move_files_to_the_new_destination($file, $folder) ); @@ -52,21 +52,21 @@ class TransferContentOwnershipToTeamFolderOwnerAction { // Move image thumbnails if ($file->type === 'image') { - // Get image thumbnail list $thumbnailList = get_thumbnail_file_list($file->basename); // move thumbnails to the new location $thumbnailList->each(function ($basename) use ($file, $folder) { - $oldPath = "files/$file->user_id/$basename"; $newPath = "files/$folder->user_id/$basename"; - if (Storage::exists($oldPath)) Storage::move($oldPath, $newPath); + if (Storage::exists($oldPath)) { + Storage::move($oldPath, $newPath); + } }); } // Move single file Storage::move("files/$file->user_id/$file->basename", "files/$folder->user_id/$file->basename"); } -} \ No newline at end of file +} diff --git a/src/Domain/Teams/Controllers/LeaveTeamFolderController.php b/src/Domain/Teams/Controllers/LeaveTeamFolderController.php index a1efa8ed..7e0ede5f 100644 --- a/src/Domain/Teams/Controllers/LeaveTeamFolderController.php +++ b/src/Domain/Teams/Controllers/LeaveTeamFolderController.php @@ -1,5 +1,4 @@ create("fake-image.jpeg", 2000, 'image/jpeg'); + ->create('fake-image.jpeg', 2000, 'image/jpeg'); // Put fake image into correct directory Storage::putFileAs("files/$member->id", $fakeFile, $fakeFile->name); @@ -624,7 +624,6 @@ class TeamManagementTest extends TestCase // Create fake image thumbnails collect(config('vuefilemanager.image_sizes')) ->each(function ($item) use ($member) { - $fakeFile = UploadedFile::fake() ->create("{$item['name']}-fake-image.jpeg", 2000, 'image/jpeg');