BUGFIX Restfulserver should use the correct way when sorting SS_Lists

This commit is contained in:
Stig Lindqvist 2011-12-08 16:04:44 +13:00 committed by Sam Minnee
parent a642a299c5
commit e22eaec204
1 changed files with 7 additions and 4 deletions

View File

@ -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')