Merge pull request #250 from deracs/master

Can't reorder many many versioned classes
This commit is contained in:
Robbie Averill 2018-03-06 16:14:22 +13:00 committed by GitHub
commit b93a8f28ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -531,8 +531,12 @@ class GridFieldOrderableRows extends RequestHandler implements
// If not a ManyManyList and using versioning, detect it.
$this->validateSortField($list);
$isVersioned = false;
$class = $list->dataClass();
$isVersioned = $class::has_extension(Versioned::class);
if (DataObject::getSchema()->tableName($class) == $this->getSortTable($list)) {
$isVersioned = $class::has_extension(Versioned::class);
}
// Loop through each item, and update the sort values which do not
// match to order the objects.