Form filters for widgets

Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization
5 Replies
BlackShadow
BlackShadow7mo ago
When having a large page with about 12 widgets it will throw the following error when loading/reloading the page
Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization
Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization
When ignoring the error and clicking it away, the page functions as normal. (Or setting all widgets to isLazy = false;) When did this error occur? After upgrading my packages:
- Upgrading anourvalar/eloquent-serialize (1.2.16 => 1.2.17)
- Upgrading archilex/filament-filter-sets (3.5.20 => 3.5.21)
- Upgrading bezhansalleh/filament-shield (3.1.0 => 3.1.1)
- Upgrading carbonphp/carbon-doctrine-types (2.0.0 => 2.1.0)
- Upgrading codewithdennis/filament-select-tree (v3.1.14 => v3.1.15)
- Upgrading dompdf/dompdf (v2.0.3 => v2.0.4)
- Upgrading filament/actions (v3.1.12 => v3.1.20)
- Upgrading filament/filament (v3.1.12 => v3.1.20)
- Upgrading filament/forms (v3.1.12 => v3.1.20)
- Upgrading filament/infolists (v3.1.12 => v3.1.20)
- Upgrading filament/notifications (v3.1.12 => v3.1.20)
- Upgrading filament/support (v3.1.12 => v3.1.20)
- Upgrading filament/tables (v3.1.12 => v3.1.20)
- Upgrading filament/widgets (v3.1.12 => v3.1.20)
- Upgrading kirschbaum-development/eloquent-power-joins (3.3.3 => 3.4.0)
- Upgrading laravel/framework (v10.35.0 => v10.37.3)
- Upgrading laravel/pint (v1.13.6 => v1.13.7)
- Upgrading laravel/pulse (v1.0.0-beta3 => v1.0.0-beta7)
- Upgrading laravel/sail (v1.26.2 => v1.26.3)
- Upgrading laravel/telescope (v4.17.2 => v4.17.3)
- Upgrading livewire/livewire (v3.2.6 => v3.3.0)
- Upgrading mockery/mockery (1.6.6 => 1.6.7)
- Upgrading nesbot/carbon (2.72.0 => 2.72.1)
- Upgrading nikic/php-parser (v4.17.1 => v4.18.0)
- Upgrading phenx/php-svg-lib (0.5.0 => 0.5.1)
- Upgrading phpstan/phpstan (1.10.47 => 1.10.50)
- Upgrading phpunit/php-code-coverage (10.1.9 => 10.1.10)
- Upgrading phpunit/phpunit (10.5.2 => 10.5.3)
- Upgrading pxlrbt/filament-excel (v2.1.8 => v2.2.0)
- Upgrading spatie/eloquent-sortable (4.0.2 => 4.1.0)
- Upgrading spatie/laravel-permission (6.1.0 => 6.2.0)
- Upgrading spatie/simple-excel (3.2.1 => 3.3.0)
- Upgrading symfony/css-selector (v6.4.0 => v7.0.0)
- Upgrading tijsverkoyen/css-to-inline-styles (2.2.6 => v2.2.7)
- Upgrading anourvalar/eloquent-serialize (1.2.16 => 1.2.17)
- Upgrading archilex/filament-filter-sets (3.5.20 => 3.5.21)
- Upgrading bezhansalleh/filament-shield (3.1.0 => 3.1.1)
- Upgrading carbonphp/carbon-doctrine-types (2.0.0 => 2.1.0)
- Upgrading codewithdennis/filament-select-tree (v3.1.14 => v3.1.15)
- Upgrading dompdf/dompdf (v2.0.3 => v2.0.4)
- Upgrading filament/actions (v3.1.12 => v3.1.20)
- Upgrading filament/filament (v3.1.12 => v3.1.20)
- Upgrading filament/forms (v3.1.12 => v3.1.20)
- Upgrading filament/infolists (v3.1.12 => v3.1.20)
- Upgrading filament/notifications (v3.1.12 => v3.1.20)
- Upgrading filament/support (v3.1.12 => v3.1.20)
- Upgrading filament/tables (v3.1.12 => v3.1.20)
- Upgrading filament/widgets (v3.1.12 => v3.1.20)
- Upgrading kirschbaum-development/eloquent-power-joins (3.3.3 => 3.4.0)
- Upgrading laravel/framework (v10.35.0 => v10.37.3)
- Upgrading laravel/pint (v1.13.6 => v1.13.7)
- Upgrading laravel/pulse (v1.0.0-beta3 => v1.0.0-beta7)
- Upgrading laravel/sail (v1.26.2 => v1.26.3)
- Upgrading laravel/telescope (v4.17.2 => v4.17.3)
- Upgrading livewire/livewire (v3.2.6 => v3.3.0)
- Upgrading mockery/mockery (1.6.6 => 1.6.7)
- Upgrading nesbot/carbon (2.72.0 => 2.72.1)
- Upgrading nikic/php-parser (v4.17.1 => v4.18.0)
- Upgrading phenx/php-svg-lib (0.5.0 => 0.5.1)
- Upgrading phpstan/phpstan (1.10.47 => 1.10.50)
- Upgrading phpunit/php-code-coverage (10.1.9 => 10.1.10)
- Upgrading phpunit/phpunit (10.5.2 => 10.5.3)
- Upgrading pxlrbt/filament-excel (v2.1.8 => v2.2.0)
- Upgrading spatie/eloquent-sortable (4.0.2 => 4.1.0)
- Upgrading spatie/laravel-permission (6.1.0 => 6.2.0)
- Upgrading spatie/simple-excel (3.2.1 => 3.3.0)
- Upgrading symfony/css-selector (v6.4.0 => v7.0.0)
- Upgrading tijsverkoyen/css-to-inline-styles (2.2.6 => v2.2.7)
Lara Zeus
Lara Zeus7mo ago
one of the widgets may causing something? try to disable and enable one by one to narrow it down
BlackShadow
BlackShadow7mo ago
I thought it would only happen sometimes, but it seems to happen randomly, even if I turn off some widgets. Even with just one widget active, if I keep refreshing the page a lot, it throws that error. When I remove all the form fields, the error goes away. If I add back only the date fields, it's fine, but when I add Select fields, the error comes back. It looks like the field isn't ready when the widgets start loading, and that's causing the crash.
Lara Zeus
Lara Zeus7mo ago
are you calling something on the Select fields like $record or the table
BlackShadow
BlackShadow7mo ago
Select::make('country')->options(Country::all()->pluck('name', 'id'))->native(false),
Select::make('country')->options(Country::all()->pluck('name', 'id'))->native(false),
But even if i set the options to [] it still happens 🤔 But when i set all the widgets to isLazy = false the page will load at once without problems. (Expected behavior) So its like the widgets starts loading before the form fields are ready. Widget Example getting the filters
$startDate = $this->filters['startDate'] ? Carbon::parse($this->filters['startDate']) : null;
$endDate = $this->filters['endDate'] ? Carbon::parse($this->filters['endDate']) : null;
$country = $this->filters['country'] ?? null;
$categories = $this->filters['categories'] ?? null;
$startDate = $this->filters['startDate'] ? Carbon::parse($this->filters['startDate']) : null;
$endDate = $this->filters['endDate'] ? Carbon::parse($this->filters['endDate']) : null;
$country = $this->filters['country'] ?? null;
$categories = $this->filters['categories'] ?? null;