mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #4644 from kinglozzer/pulls/gfsortableheader-hasdbfield
FIX: GridFieldSortableHeader incorrectly reporting fields as sortable
This commit is contained in:
commit
9953c5f9c0
@ -114,8 +114,8 @@ class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataM
|
|||||||
} elseif(method_exists($tmpItem, 'hasMethod') && $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->hasDatabaseField($methodName)) {
|
||||||
// Else, if we've found a field at the end of the chain, we can sort on it.
|
// Else, if we've found a database field at the end of the chain, we can sort on it.
|
||||||
// If a method is applied further to this field (E.g. 'Cost.Currency') then don't try to sort.
|
// If a method is applied further to this field (E.g. 'Cost.Currency') then don't try to sort.
|
||||||
$allowSort = $idx === sizeof($parts) - 1;
|
$allowSort = $idx === sizeof($parts) - 1;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user