mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Improved how the last edit table is found using ClassInfo::baseDataClass()
This commit is contained in:
parent
60c8939f45
commit
f75ebaea34
@ -183,6 +183,8 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
||||
user_error('Sort column '.$this->sortColumn.' could not be found in '.$gridField->getModelClass().'\'s ancestry', E_USER_ERROR);
|
||||
exit;
|
||||
}
|
||||
|
||||
$baseDataClass=ClassInfo::baseDataClass($gridField->getModelClass());
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +204,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
||||
. '" SET "' . $sortColumn . '" = ' . ($max + $i)
|
||||
. ' WHERE "ID" = '. $obj->ID);
|
||||
|
||||
DB::query('UPDATE "' . ClassInfo::baseDataClass($gridField->getModelClass())
|
||||
DB::query('UPDATE "' . $baseDataClass
|
||||
. '" SET "LastEdited" = \'' . date('Y-m-d H:i:s') . '\''
|
||||
. ' WHERE "ID" = '. $obj->ID);
|
||||
}
|
||||
@ -312,6 +314,8 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
||||
user_error('Sort column '.$this->sortColumn.' could not be found in '.$gridField->getModelClass().'\'s ancestry', E_USER_ERROR);
|
||||
exit;
|
||||
}
|
||||
|
||||
$baseDataClass=ClassInfo::baseDataClass($gridField->getModelClass());
|
||||
}
|
||||
|
||||
|
||||
@ -333,7 +337,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
||||
. '" SET "' . $sortColumn . '" = ' . (($sort + 1) + $pageOffset)
|
||||
. ' WHERE "ID" = '. $id);
|
||||
|
||||
DB::query('UPDATE "' . ClassInfo::baseDataClass($gridField->getModelClass())
|
||||
DB::query('UPDATE "' . $baseDataClass
|
||||
. '" SET "LastEdited" = \'' . date('Y-m-d H:i:s') . '\''
|
||||
. ' WHERE "ID" = '. $id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user