diff --git a/CHANGELOG.md b/CHANGELOG.md index 65c5891..616e876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [2.0.3](https://github.com/UndefinedOffset/SortableGridField/tree/2.0.3) (2018-03-01) +[Full Changelog](https://github.com/UndefinedOffset/SortableGridField/compare/2.0.2...2.0.3) + ## [2.0.2](https://github.com/UndefinedOffset/SortableGridField/tree/2.0.2) (2017-12-11) [Full Changelog](https://github.com/UndefinedOffset/SortableGridField/compare/2.0.1...2.0.2) diff --git a/src/Forms/GridFieldSortableRows.php b/src/Forms/GridFieldSortableRows.php index 270984e..bd80b69 100644 --- a/src/Forms/GridFieldSortableRows.php +++ b/src/Forms/GridFieldSortableRows.php @@ -234,11 +234,11 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP $sng = singleton($gridField->getModelClass()); $fieldType = $sng->config()->db[$this->sortColumn]; - if (!$fieldType || !(strtolower($fieldType) == 'int' || is_subclass_of($fieldType, 'Int'))) { + if (!$fieldType || !($fieldType == 'SilverStripe\\ORM\\FieldType\\DBInt' || is_subclass_of($fieldType, 'SilverStripe\\ORM\\FieldType\\DBInt'))) { if (is_array($fieldType)) { user_error('Sort column ' . $this->sortColumn . ' could not be found in ' . $gridField->getModelClass() . '\'s ancestry', E_USER_ERROR); } else { - user_error('Sort column ' . $this->sortColumn . ' must be an Int, column is of type ' . $fieldType, E_USER_ERROR); + user_error('Sort column ' . $this->sortColumn . ' must be an instance of SilverStripe\\ORM\\FieldType\\DBInt, column is of type ' . $fieldType, E_USER_ERROR); } exit;