mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Fixed potential issue with DBInt
This commit is contained in:
parent
e53e3622a4
commit
20da27f7dd
@ -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)
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user