Skip to content

Commit b304982

Browse files
committed
fix ambiguous error
1 parent 07d83cd commit b304982

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Forms/GridFieldSortableRows.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ protected function fixSortColumn($gridField, SS_List $dataList)
335335
} else if ($this->append_to_top) {
336336
if ($hasVersioned) {
337337
// For versioned objects, modify them with the ORM so that the *_versions table is updated
338-
$itemsToUpdate = $modelClass::get()->where(($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
338+
$itemsToUpdate = $modelClass::get()->where(($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "' . $table . '"."ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
339339
if ($itemsToUpdate->exists()) {
340340
foreach ($itemsToUpdate as $item) {
341341
$item->$sortColumn = $item->$sortColumn + 1;
@@ -346,13 +346,13 @@ protected function fixSortColumn($gridField, SS_List $dataList)
346346
//Upgrade all the records (including the last inserted from 0 to 1)
347347
DB::query('UPDATE "' . $table
348348
. '" SET "' . $sortColumn . '" = "' . $sortColumn . '"+1'
349-
. ' WHERE ' . ($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
349+
. ' WHERE ' . ($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "' . $table . '"."ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
350350
}
351351

352352
if ($this->update_versioned_stage && $this->hasVersionedExtension($gridField->getModelClass())) {
353353
DB::query('UPDATE "' . $table . '_' . $this->update_versioned_stage
354354
. '" SET "' . $sortColumn . '" = "' . $sortColumn . '"+1'
355-
. ' WHERE ' . ($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '_' . $this->update_versioned_stage . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
355+
. ' WHERE ' . ($list instanceof RelationList ? '"' . $list->foreignKey . '" = ' . $owner->ID : '"' . $table . '_' . $this->update_versioned_stage . '".' . $idCondition) . (!empty($topIncremented) ? ' AND "' . $table . '"."ID" NOT IN(\'' . implode('\',\'', $topIncremented) . '\')' : ''));
356356
}
357357

358358
$topIncremented[] = $obj->ID;

0 commit comments

Comments
 (0)