Improved how the last edit table is found using ClassInfo::baseDataClass()

This commit is contained in:
Ed 2013-05-25 20:42:35 -03:00
parent 60c8939f45
commit f75ebaea34

View File

@ -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);
}