From 1a55c0599cedbde560441934b9af106f032cb86c Mon Sep 17 00:00:00 2001 From: Peter Thaleikis Date: Thu, 10 Dec 2015 09:31:55 +1300 Subject: [PATCH] Fixing bug "must be an Int, column is of type int" --- code/forms/GridFieldSortableRows.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index 60cbb50..20634d2 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -163,7 +163,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP if (!$many_many) { $sng=singleton($gridField->getModelClass()); $fieldType=$sng->db($this->sortColumn); - if(!$fieldType || !($fieldType=='Int' || is_subclass_of('Int', $fieldType))) { + if(!$fieldType || !(strtolower($fieldType) == 'int' || is_subclass_of('Int', $fieldType))) { if(is_array($fieldType)) { user_error('Sort column '.$this->sortColumn.' could not be found in '.$gridField->getModelClass().'\'s ancestry', E_USER_ERROR); }else { @@ -571,4 +571,4 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP } } } -?> +?> \ No newline at end of file