From cccc5241cd8eeedef2bd3a71a992590bb8c6d0db Mon Sep 17 00:00:00 2001 From: Jake Bentvelzen Date: Wed, 22 Jun 2016 11:27:38 +1000 Subject: [PATCH] fix(GridFieldOrderableRows/ArrayList): Fix ->sort on ArrayList to not use quotes (to work around a bug in framework 3.1+) --- code/GridFieldOrderableRows.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/GridFieldOrderableRows.php b/code/GridFieldOrderableRows.php index 57873da..6524ddf 100755 --- a/code/GridFieldOrderableRows.php +++ b/code/GridFieldOrderableRows.php @@ -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;