Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Forms/GridFieldSortableRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ protected function fixSortColumn($gridField, SS_List $dataList)
} else if ($this->append_to_top) {
if ($hasVersioned) {
// For versioned objects, modify them with the ORM so that the *_versions table is updated
$itemsToUpdate = $modelClass::get()->where(($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
$itemsToUpdate = $modelClass::get()->where(($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "' . $table . '"."ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
if ($itemsToUpdate->exists()) {
foreach ($itemsToUpdate as $item) {
$item->$sortColumn = $item->$sortColumn + 1;
Expand Down