filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.08k stars 2.83k forks source link

Infolists\Components\Actions\Action get an error in a view modal #8034

Closed breakzhuo closed 1 year ago

breakzhuo commented 1 year ago

Package

filament/filament

Package Version

v3.0.30

Laravel Version

v10.20.0

Livewire Version

v3.0.0-beta.10

PHP Version

8.1.0

Problem description

Infolists\Components\Actions\Action get an error in a view modal,using the same code.

image

simple ( view in a modal),i got:

image

Expected behavior

image

Steps to reproduce

1.add this code to a ViewAction : Infolists\Components\TextEntry::make('title') ->hint('wwww') ->hintAction( Infolists\Components\Actions\Action::make('resetStars') ->icon('heroicon-m-x-mark') ->color('danger') ->requiresConfirmation() ),

  1. ViewAction is "simple",show in a modal
  2. trigger ViewAction

Reproduction repository

https://github.com/filamentphp/demo

Relevant log output

Typed property Filament\Infolists\Infolist::$name must not be accessed before initialization
github-actions[bot] commented 1 year ago

Hey @breakzhuo! 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 GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. 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.

ralphjsmit commented 1 year ago

I'm also getting this error. It is as simple as adding any Action in an infolist modal. For example, a table action with an infolist:

Infolists\Components\Actions::make([
    Infolists\Components\Actions\Action::make('download')
        ->icon('heroicon-o-arrow-down-tray')
        ->action(function () {
            dd('X');
        }),
]),

Can this one be re-opened @danharrin?

danharrin commented 1 year ago

Duplicate #7630

ralphjsmit commented 1 year ago

Okay, thank you!