MedicOneSystems / MedicOneSystems/livewire-datatables
Bug addSort
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
it should look like this:
$this->query->orderBy(DB::raw('FIELD('.$this->query->from.'.id,' . implode(',', $this->pinnedRecords) . ')'), 'DESC');
Otherwise it could stop working if you use more relations
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open src/Http/Livewire/LivewireDatatable.php at the referenced line and inspect how addSort builds its orderBy expression, including the query's from table and pinned records. Compare the current relation handling with the expression shown in the issue. Done means pinned records remain correctly ordered when additional relations are used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100