Skip to content

Commit

Permalink
Merge pull request #36 from bummzack/fix-sorting-of-sitetree-subclasses
Browse files Browse the repository at this point in the history
Fixing automatic-sort of SiteTree subclasses.
  • Loading branch information
stevie-mayhew committed Nov 3, 2015
2 parents 261ed67 + 8662bfc commit 9c32938
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/ModelAdmin/CatalogPageAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function onAfterGridFieldRowSort($pages)
}
if ($model::config()->get('automatic_live_sort') == true) {
foreach ($pages as $page) {
if(get_class($page) == $modelClass) {
if($page instanceof $modelClass) {
DB::query("UPDATE " . $modelClass . "_Live SET " . $model->getSortFieldname() . "=" . $page->{$model->getSortFieldname()} . " WHERE ID=" . $page->ID);
}
}
Expand Down

0 comments on commit 9c32938

Please sign in to comment.