mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Check that method 'hasMethod' exists in GridFieldSortableHeader
This commit is contained in:
parent
4485b266e2
commit
1b6442058d
@ -111,7 +111,7 @@ class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataM
|
|||||||
if($tmpItem instanceof SS_List) {
|
if($tmpItem instanceof SS_List) {
|
||||||
// It's impossible to sort on a HasManyList/ManyManyList
|
// It's impossible to sort on a HasManyList/ManyManyList
|
||||||
break;
|
break;
|
||||||
} elseif($tmpItem->hasMethod($methodName)) {
|
} elseif(method_exists($tmpItem, 'hasMethod') && $tmpItem->hasMethod($methodName)) {
|
||||||
// The part is a relation name, so get the object/list from it
|
// The part is a relation name, so get the object/list from it
|
||||||
$tmpItem = $tmpItem->$methodName();
|
$tmpItem = $tmpItem->$methodName();
|
||||||
} elseif($tmpItem instanceof DataObject && $tmpItem->hasField($methodName)) {
|
} elseif($tmpItem instanceof DataObject && $tmpItem->hasField($methodName)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user