I’m having some trouble with undocumented behavior that I’ve occasionally used in my projects.
A) List column can be defined this documented way:
schedule_start:
relation: schedule
select: starts_at
In this case, when sorting by the schedule_start column is activated, the entire list is correctly sorted by schedule_start (by the relationship value).
B) List column can be defined this way too:
schedule_name:
relation: schedule
valueFrom: name
In this case, when sorting by the schedule_name column is enabled, the entire list is incorrectly sorted by the base table name column (not by the relationship value - the reason is that this value can be result of Eloquent Accessor, not SQL table column!).
C) But nevermind, this behavior is known since version 1. There were/could be hack - using undocumented combination:
schedule_name:
relation: schedule
select: starts_at
valueFrom: name
When sorting by the schedule_name column is enabled, the entire list can be sorted by the selected value (start_at
), because this database column is part of the SQL statement, but finally display the relationship value name
in the entire list.
I think this hack worked in past, but priority of select
and valueFrom
was changed and valueFrom
is used in sorting instead of select
one (so the result is sorting like in example B).
Is it possible to make example C documented and working correct way?