BUG Fix crash when re-ordering pages (#6281)

Fixes #6273
This commit is contained in:
Damian Mooyman 2016-11-03 14:51:17 +13:00 committed by Sam Minnée
parent eefecc21fc
commit cc451d9ca4

View File

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