Fixed query error causing crash on postgres (fixes #87)

This commit is contained in:
Ed Chipman 2016-02-13 13:43:39 -04:00
parent d37fdd2ea9
commit 2f5cee4e36
2 changed files with 1 additions and 6 deletions

View File

@ -15,11 +15,6 @@ env:
- DB=SQLITE3 CORE_RELEASE=3.1
- DB=SQLITE3 CORE_RELEASE=3.2
matrix:
allow_failures:
- env: DB=PGSQL CORE_RELEASE=3.1
- env: DB=PGSQL CORE_RELEASE=3.2
before_script:
- phpenv rehash
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support

View File

@ -287,7 +287,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
if($this->update_versioned_stage && class_exists($table) && Object::has_extension($table, 'Versioned')) {
DB::query('UPDATE "' . $table . '_' . $this->update_versioned_stage
. '" SET "' . $sortColumn . '" = "' . $sortColumn .'"+1'
. ' WHERE "ID" = '. ($list instanceof RelationList ? '"' . $list->foreignKey . '" = '. $owner->ID:$idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\''.implode('\',\'', $topIncremented).'\')':''));
. ' WHERE '. ($list instanceof RelationList ? '"' . $list->foreignKey . '" = '. $owner->ID:$idCondition) . (!empty($topIncremented) ? ' AND "ID" NOT IN(\''.implode('\',\'', $topIncremented).'\')':''));
if(Object::has_extension($baseDataClass, 'Versioned')) {
DB::query('UPDATE "' . $baseDataClass . '_' . $this->update_versioned_stage