Skip to content

Commit 9c32938

Browse files
committed
Merge pull request #36 from bummzack/fix-sorting-of-sitetree-subclasses
Fixing automatic-sort of SiteTree subclasses.
2 parents 261ed67 + 8662bfc commit 9c32938

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/ModelAdmin/CatalogPageAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function onAfterGridFieldRowSort($pages)
112112
}
113113
if ($model::config()->get('automatic_live_sort') == true) {
114114
foreach ($pages as $page) {
115-
if(get_class($page) == $modelClass) {
115+
if($page instanceof $modelClass) {
116116
DB::query("UPDATE " . $modelClass . "_Live SET " . $model->getSortFieldname() . "=" . $page->{$model->getSortFieldname()} . " WHERE ID=" . $page->ID);
117117
}
118118
}

0 commit comments

Comments
 (0)