Skip to content

Commit

Permalink
Fixed GridFieldOrderableRows issue when data class is Versioned and r…
Browse files Browse the repository at this point in the history
…elation is has_many (#243)

* Fixed GridFieldOrderableRows issue when data class is Versioned and relation is has_many

* just compare table names rather than updating existing getSortTable() func
  • Loading branch information
Priyashantha authored and robbieaverill committed Feb 11, 2018
1 parent 509abf1 commit 6d8b41e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GridFieldOrderableRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
use SilverStripe\ORM\DataObjectInterface;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\ManyManyList;
use SilverStripe\ORM\Map;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\SS_Map;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ViewableData;

Expand Down Expand Up @@ -529,7 +529,7 @@ protected function reorderItems($list, array $values, array $sortedIDs)
/** @var SS_List $map */
$map = $list->map('ID', $sortField);
//fix for versions of SS that return inconsistent types for `map` function
if ($map instanceof SS_Map) {
if ($map instanceof Map) {
$map = $map->toArray();
}

Expand Down

0 comments on commit 6d8b41e

Please sign in to comment.