Replies: 1 comment
-
Hi, I'm moving this to discussion, as this is not a problem worth mentioning here. You can fix it and open a pull request if you know how to fix it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Have you searched through other issues to see if your problem is already reported or has been fixed?
Yes, I did not find it.
Did you read the documentation?
Yes, I did not find it.
Have you tried to publish the views?
Yes - I didn't work.
Is there an error in the console?
No
PHP Version
8.2
PowerGrid
4.9.8
Laravel
10.48.12
Livewire
2.12.6
Alpine JS
3.14.0
Theme
Bootstrap
Describe the bug.
When using select filter data source as a sorted collection we get the following error after search
Livewire encountered corrupt data when trying to hydrate the component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests.
To Reproduce...
This code produce error after selecting some value from the dropdown
Filter::select('contract_type_id', 'contract_type_id') ->dataSource(ContractType::all()->sortBy('name')) ->optionValue('id') ->optionLabel('name'),
Error:
Livewire encountered corrupt data when trying to hydrate the component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests.
This works fine without the sortBy
Filter::select('contract_type_id', 'contract_type_id') ->dataSource(ContractType::all()) ->optionValue('id') ->optionLabel('name')
This is how columns are setup
->addColumn('contract_type_id', function (Offer $offer) { return $offer->contractType->name; })
columns function
Column::make('Type', 'contract_type_id')->sortable(),
data source:
public function datasource(): Builder|Offer { // query to get data return Offer::query()->with(['contractType']); }
The table is very simple with just two columns
id: primary key auto increment
name: varchar
Extra information
Beta Was this translation helpful? Give feedback.
All reactions