mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02: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
4855ac5ec0
commit
ea637b0ad5
@ -190,7 +190,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
||||
$sortterm = $this->extraSortFields.', ';
|
||||
}
|
||||
}
|
||||
$sortterm .= $this->getSortField();
|
||||
$sortterm .= $this->getSortTable($list).'.'.$this->getSortField();
|
||||
return $list->sort($sortterm);
|
||||
} else {
|
||||
return $list;
|
||||
@ -226,7 +226,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
||||
$sortterm = $this->extraSortFields.', ';
|
||||
}
|
||||
}
|
||||
$sortterm .= $field;
|
||||
$sortterm .= $this->getSortTable($list).'.'.$field;
|
||||
$items = $list->filter('ID', $ids)->sort($sortterm);
|
||||
|
||||
// Ensure that each provided ID corresponded to an actual object.
|
||||
|
Loading…
Reference in New Issue
Block a user