diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 5d7d9f7b3..b687a51b3 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -1451,8 +1451,9 @@ class LeftAndMain extends Controller implements PermissionProvider { // Nodes that weren't "actually moved" shouldn't be registered as // having been edited; do a direct SQL update instead ++$counter; + $table = DataObject::getSchema()->baseDataTable($className); DB::prepared_query( - "UPDATE \"$className\" SET \"Sort\" = ? WHERE \"ID\" = ?", + "UPDATE \"$table\" SET \"Sort\" = ? WHERE \"ID\" = ?", array($counter, $id) ); }