mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00:00
GridFieldOrderableRows: Prefix sort field with table name when sorting
Prevents ambiguities when the GridField's underlying DataList uses a query that joins multiple tables having a sort field.
This commit is contained in:
parent
9ff5de80d4
commit
d0c0426b1d
@ -128,7 +128,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
||||
$state->GridFieldOrderableRows->enabled = !$sorted;
|
||||
|
||||
if(!$sorted) {
|
||||
return $list->sort($this->getSortField());
|
||||
return $list->sort($this->getSortTable($list).'.'.$this->getSortField());
|
||||
} else {
|
||||
return $list;
|
||||
}
|
||||
@ -150,7 +150,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
||||
$this->httpError(400);
|
||||
}
|
||||
|
||||
$items = $list->byIDs($ids)->sort($field);
|
||||
$items = $list->byIDs($ids)->sort($this->getSortTable($list).'.'.$field);
|
||||
|
||||
// Ensure that each provided ID corresponded to an actual object.
|
||||
if(count($items) != count($ids)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user