Filter value=null error after refreshing page
I have a simple filter in my Resource's table:
I open the resource table from the url:
http://127.0.0.1:8000/admin/all-orders
This sql query runs:
All good.
Now I set the filter once to something
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=1
I refresh the page, still all good
Than delete the filter, and get to this url:
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=null
I refresh, and no result are shown and this sql query is run:
The service is always an integer, can't be null.
Is it the intended way for the url query to switch to null, in case I delete the filter?
I noticed, that this isn't the case when I never refresh the site, that is what's causing the problem.
Solution:Jump to solution
This is a known issue with Livewire v3. Filament Issue here: https://github.com/filamentphp/filament/issues/7129
At the bottom there is a workaround you can implement in the meantime....
GitHub
Query string includes all available filters causing an error on ref...
Package filament/filament Package Version v3 Laravel Version v9.19 Livewire Version v3 PHP Version PHP 8.1 Problem description In v3 when you select a filter, the query string will then populate wi...
5 Replies
It also adds a 3rd option to the filter select field:
And that is selected when I open the url
I checked another simpler resource, and it doesn't have this issue
Solution
This is a known issue with Livewire v3. Filament Issue here: https://github.com/filamentphp/filament/issues/7129
At the bottom there is a workaround you can implement in the meantime.
GitHub
Query string includes all available filters causing an error on ref...
Package filament/filament Package Version v3 Laravel Version v9.19 Livewire Version v3 PHP Version PHP 8.1 Problem description In v3 when you select a filter, the query string will then populate wi...
Thank you very much!
@kennethsese thank you for the time you put into this problem on github!