filament icon indicating copy to clipboard operation
filament copied to clipboard

Soft Delete Restore Action button on pageview

Open MarJose123 opened this issue 3 years ago • 5 comments

Package

filament/filament

Package Version

v2

Laravel Version

v9

Livewire Version

v2

PHP Version

v8

Problem description

Filament\Pages\Actions\RestoreAction::Filament\Pages\Actions{closure}(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, null given

image

Expected behavior

it should prompt a notification restored something.

Steps to reproduce

make sure your page has enabled the soft-delete.

  1. add the Actions\RestoreAction::make()->icon('heroicon-o-trash') on your ViewPage.
  2. Create record
  3. Delete the record
  4. restore the deleted record

Reproduction repository

https://github.com/whoami213/FilamentPHP-ViewPage-Error

Relevant log output

Filament\Pages\Actions\RestoreAction::Filament\Pages\Actions\{closure}(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, null given, called in /home/unhex/self_project/eBMS-v3/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php on line 36

MarJose123 avatar Aug 03 '22 09:08 MarJose123

Hey @whoami213! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public Git repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

github-actions[bot] avatar Aug 03 '22 09:08 github-actions[bot]

Hi @danharrin can you check if this something a totally issues on my end only?

MarJose123 avatar Aug 04 '22 03:08 MarJose123

Yeah, we can have a look if you submit the reproduction repository URL, just edit your original message

danharrin avatar Aug 04 '22 06:08 danharrin

I've update the repo link

MarJose123 avatar Aug 04 '22 10:08 MarJose123

Thank you for providing reproduction steps! Reopening the issue now.

github-actions[bot] avatar Aug 04 '22 10:08 github-actions[bot]

I also experience this issue with the DeleteAction. It's quite serious, since it breaks the Delete buttons in entire applications.

@danharrin I can privately share a Flare stacktrace if you want.

ralphjsmit avatar Aug 18 '22 18:08 ralphjsmit

Fixed by #3587.

danharrin avatar Aug 20 '22 14:08 danharrin