Skip to content

Commit

Permalink
BUGFIX Restfulserver should use the correct way when sorting SS_Lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Stig Lindqvist authored and Sam Minnee committed Dec 17, 2011
1 parent a642a29 commit e22eaec
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api/RestfulServer.php
Expand Up @@ -203,10 +203,13 @@ function index() {
* @return String The serialized representation of the requested object(s) - usually XML or JSON.
*/
protected function getHandler($className, $id, $relationName) {
$sort = array(
'sort' => $this->request->getVar('sort'),
'dir' => $this->request->getVar('dir')
);
$sort = '';

if($this->request->getVar('sort')) {
$dir = $this->request->getVar('dir');
$sort = array($this->request->getVar('sort') => ($dir ? $dir : 'ASC'));
}

$limit = array(
'start' => $this->request->getVar('start'),
'limit' => $this->request->getVar('limit')
Expand Down

0 comments on commit e22eaec

Please sign in to comment.