mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
BUGFIX: Use config layer to check for decorated $db fields
This commit is contained in:
parent
7a9916bcf5
commit
1575323037
@ -149,12 +149,14 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
|||||||
$table=false;
|
$table=false;
|
||||||
$class=$gridField->getModelClass();
|
$class=$gridField->getModelClass();
|
||||||
|
|
||||||
if(!empty($class::$db) && array_key_exists($sortColumn, $class::$db)) {
|
$db = Config::inst()->get($class, "db", CONFIG::UNINHERITED);
|
||||||
|
if(!empty($db) && array_key_exists($sortColumn, $db)) {
|
||||||
$table=$class;
|
$table=$class;
|
||||||
}else {
|
}else {
|
||||||
$classes=ClassInfo::ancestry($class, true);
|
$classes=ClassInfo::ancestry($class, true);
|
||||||
foreach($classes as $class) {
|
foreach($classes as $class) {
|
||||||
if(!empty($class::$db) && array_key_exists($sortColumn, $class::$db)) {
|
$db = Config::inst()->get($class, "db", CONFIG::UNINHERITED);
|
||||||
|
if(!empty($db) && array_key_exists($sortColumn, $db)) {
|
||||||
$table=$class;
|
$table=$class;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -264,14 +266,15 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
|||||||
}else {
|
}else {
|
||||||
//Find table containing the sort column
|
//Find table containing the sort column
|
||||||
$table=false;
|
$table=false;
|
||||||
$class=$gridField->getModelClass();
|
$class=$gridField->getModelClass();
|
||||||
|
$db = Config::inst()->get($class, "db", CONFIG::UNINHERITED);
|
||||||
if(!empty($class::$db) && array_key_exists($sortColumn, $class::$db)) {
|
if(!empty($db) && array_key_exists($sortColumn, $db)) {
|
||||||
$table=$class;
|
$table=$class;
|
||||||
}else {
|
}else {
|
||||||
$classes=ClassInfo::ancestry($class, true);
|
$classes=ClassInfo::ancestry($class, true);
|
||||||
foreach($classes as $class) {
|
foreach($classes as $class) {
|
||||||
if(!empty($class::$db) && array_key_exists($sortColumn, $class::$db)) {
|
$db = Config::inst()->get($class, "db", CONFIG::UNINHERITED);
|
||||||
|
if(!empty($db) && array_key_exists($sortColumn, $db)) {
|
||||||
$table=$class;
|
$table=$class;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user