From db1316f878d3238d3cbdfe386600136783da1441 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 17 Aug 2026 17:00:00 +0200 Subject: [PATCH] fix(backups): render form for directory-only targets (#11332) --- app/Livewire/Project/Application/Backup/Create.php | 2 +- tests/Feature/VolumeBackupTest.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/Livewire/Project/Application/Backup/Create.php b/app/Livewire/Project/Application/Backup/Create.php index 68115e775..f26d81b88 100644 --- a/app/Livewire/Project/Application/Backup/Create.php +++ b/app/Livewire/Project/Application/Backup/Create.php @@ -82,7 +82,7 @@ class Create extends Component 'type' => 'Directory', 'name' => $directory->fs_path, ]); - $this->targets = $volumes->concat($directories)->values(); + $this->targets = collect($volumes->concat($directories)->all())->values(); $this->targetKey = $this->selectedTargetKey ?? data_get($this->targets->first(), 'key'); $this->loadSelectedBackup(); } diff --git a/tests/Feature/VolumeBackupTest.php b/tests/Feature/VolumeBackupTest.php index 88e679a7c..496894591 100644 --- a/tests/Feature/VolumeBackupTest.php +++ b/tests/Feature/VolumeBackupTest.php @@ -222,6 +222,18 @@ it('creates a scheduled backup for a preselected application directory', functio expect(ScheduledVolumeBackup::query()->sole()->backupable->is($directory))->toBeTrue(); }); +it('renders the backup form for an application with only a directory target', function () { + $team = Team::factory()->create(); + signInForVolumeBackups($this, $team); + [$application, $volume] = createVolumeBackupApplication($team); + $volume->delete(); + $directory = createApplicationBackupDirectory($application); + + Livewire::test(CreateScheduledVolumeBackup::class, ['application' => $application]) + ->assertSet('targetKey', 'directory:'.$directory->id) + ->assertSuccessful(); +}); + it('rejects files and directory mounts owned by another application as backup targets', function () { $team = Team::factory()->create(); signInForVolumeBackups($this, $team);