rappasoft/laravel-livewire-tables

[Bug]: Sorting deep relations

levizoesch opened this issue · 4 comments

What happened?

If you sort a column that is a deep relation, the url param will be [filter][value] where as it should be [filter.value].

How to reproduce the bug

Column::make('Bank','bank.alias')
->searchable()
->sortable()
->collapseOnMobile(),

image
vs
image

Package Version

3.x

PHP Version

8.1.x

Laravel Version

10.x

Error Message

Rappasoft\LaravelLivewireTables\Views\Column::getSortingPillDirection(): Argument #2 ($direction) must be of type string, array given, called in /home/.../storage/framework/views/b496047e5597363e8385316850f702ff.php on line 134 (View: /home/.../vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/sorting-pills.blade.php)

Possible fix, needs further testing

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

We're facing the same issue. Was there a fix to it?

EDIT: This happens only when using a filter AFTER applying a sort. If the filter is applied before the sorting, then it doesn't break.

We're facing the same issue. Was there a fix to it?

EDIT: This happens only when using a filter AFTER applying a sort. If the filter is applied before the sorting, then it doesn't break.

Yes this bug has been resolved in later versions of both Livewire, and Livewire Tables.

This bug was a issue particularly with Livewire changes early on in 3.0, and how Livewire Tables was handling things.