Skip to content

[Bug]: Order by status throws exception #61

@verplicht

Description

@verplicht

What happened?

When click on the arrow icon behind the status column, I expected the list to be sorted by status

How to reproduce the bug

  • Go to mails overview (/admin/mails)
  • Click on 'Status'
  • Exception is thrown

Package Version

2.3.8

PHP Version

8.2.29

Laravel Version

11.46.1

Which operating systems does with happen with?

No response

Notes

Using version 2.3.8 of filament-mails (but looking at the current main, I expect it's an issue in 3.x aswell)

When ordering mails by status, an exception is thrown:

Illuminate\Database\QueryException
PHP 8.2.29
11.45.1
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'ORDER BY'
select * from `mails` order by `status` asc limit 50 offset 0

Because the status attribute, is computes.

Suggested fix in the MailResource::table() (line 321-ish):

                Tables\Columns\TextColumn::make('status')
                    ->label(__('Status'))
                    ->sortable(false)
                    ->searchable(false)

instead of:

                Tables\Columns\TextColumn::make('status')
                    ->label(__('Status'))
                    ->sortable()
                    ->searchable(false)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions