Skip to content

Commit

Permalink
Merge pull request #62 from Rhym/hotfix/publish-pages
Browse files Browse the repository at this point in the history
Fixed an issue where pages were not publishing
  • Loading branch information
Rhym authored Jul 29, 2019
2 parents 2e27dba + ebc9f7e commit 8d3e6da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Extensions/AutoPublishSortExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function onAfterReorderItems(SS_List &$list, array $values, array $sorted

foreach ($sortedIDs as $sortValue => $itemID) {
DB::prepared_query('UPDATE "' . $tableName . '_Live" SET "' . $sortField . '"=? WHERE "ID"=?', [$sortValue, $itemID]);
$version = DB::prepared_query('SELECT Version FROM "' . $tableName . '_Versions" WHERE "RecordID"=? ORDER BY "ID" DESC', [$itemID]);
DB::prepared_query('UPDATE "' . $tableName . '_Live" SET "Version"=? WHERE "ID"=?', [$version->first()['Version'], $itemID]);
}
}
}

0 comments on commit 8d3e6da

Please sign in to comment.