mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Restfulserver should use the correct way when sorting SS_Lists
This commit is contained in:
parent
a642a299c5
commit
e22eaec204
@ -203,10 +203,13 @@ class RestfulServer extends Controller {
|
|||||||
* @return String The serialized representation of the requested object(s) - usually XML or JSON.
|
* @return String The serialized representation of the requested object(s) - usually XML or JSON.
|
||||||
*/
|
*/
|
||||||
protected function getHandler($className, $id, $relationName) {
|
protected function getHandler($className, $id, $relationName) {
|
||||||
$sort = array(
|
$sort = '';
|
||||||
'sort' => $this->request->getVar('sort'),
|
|
||||||
'dir' => $this->request->getVar('dir')
|
if($this->request->getVar('sort')) {
|
||||||
);
|
$dir = $this->request->getVar('dir');
|
||||||
|
$sort = array($this->request->getVar('sort') => ($dir ? $dir : 'ASC'));
|
||||||
|
}
|
||||||
|
|
||||||
$limit = array(
|
$limit = array(
|
||||||
'start' => $this->request->getVar('start'),
|
'start' => $this->request->getVar('start'),
|
||||||
'limit' => $this->request->getVar('limit')
|
'limit' => $this->request->getVar('limit')
|
||||||
|
Loading…
Reference in New Issue
Block a user