Merge pull request #150 from SilbinaryWolf/fix-arraylistsort

fix(GridFieldOrderableRows/ArrayList): Fix ->sort on ArrayList
This commit is contained in:
Marcus 2016-06-22 12:01:29 +10:00 committed by GitHub
commit 1d4f24de36
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;