mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02: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) {
|
||||
// It's impossible to sort on a HasManyList/ManyManyList
|
||||
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
|
||||
$tmpItem = $tmpItem->$methodName();
|
||||
} elseif($tmpItem instanceof DataObject && $tmpItem->hasField($methodName)) {
|
||||
|
Loading…
Reference in New Issue
Block a user