fix(GridFieldOrderableRows/ArrayList): Fix ->sort on ArrayList to not use quotes (to work around a bug in framework 3.1+)

This commit is contained in:
Jake Bentvelzen 2016-06-22 11:27:38 +10:00
parent b04595c975
commit cccc5241cd
1 changed files with 6 additions and 1 deletions

View File

@ -226,7 +226,12 @@ class GridFieldOrderableRows extends RequestHandler implements
$sortterm = $this->extraSortFields.', ';
}
}
$sortterm .= '"'.$this->getSortTable($list).'"."'.$this->getSortField().'"';
if ($list instanceof ArrayList) {
// Fix bug in 3.1.3+ where ArrayList doesn't account for quotes
$sortterm .= $this->getSortTable($list).'.'.$this->getSortField();
} else {
$sortterm .= '"'.$this->getSortTable($list).'"."'.$this->getSortField().'"';
}
return $list->sort($sortterm);
} else {
return $list;