mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Better handling of error if the sort column cannot be found in model classes db fields
This commit is contained in:
parent
4a9c663d9c
commit
426b6173c6
@ -134,7 +134,12 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
|||||||
$sng=singleton($gridField->getModelClass());
|
$sng=singleton($gridField->getModelClass());
|
||||||
$fieldType=$sng->db($this->sortColumn);
|
$fieldType=$sng->db($this->sortColumn);
|
||||||
if(!$fieldType || !($fieldType=='Int' || is_subclass_of('Int', $fieldType))) {
|
if(!$fieldType || !($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 {
|
||||||
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 Int, column is of type '.$fieldType, E_USER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user