Fixing bug "must be an Int, column is of type int"

This commit is contained in:
Peter Thaleikis 2015-12-10 09:31:55 +13:00 committed by Ed Chipman
parent afffa5b09e
commit 1a55c0599c

View File

@ -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
}
}
}
?>
?>