This commit is contained in:
Daniel Hensby 2018-06-25 02:30:24 +00:00 committed by GitHub
commit 143029305a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,7 @@ use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataObjectInterface;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\ManyManyList;
use SilverStripe\ORM\ManyManyThroughList;
use SilverStripe\ORM\Map;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\FieldType\DBDatetime;
@ -183,7 +184,7 @@ class GridFieldOrderableRows extends RequestHandler implements
{
$field = $this->getSortField();
if ($list instanceof ManyManyList) {
if ($list instanceof ManyManyList || $list instanceof ManyManyThroughList) {
$extra = $list->getExtraFields();
if ($extra && array_key_exists($field, $extra)) {
@ -211,7 +212,7 @@ class GridFieldOrderableRows extends RequestHandler implements
public function getSortTable(SS_List $list)
{
$field = $this->getSortField();
if ($list instanceof ManyManyList) {
if ($list instanceof ManyManyList || $list instanceof ManyManyThroughList) {
$extra = $list->getExtraFields();
$table = $list->getJoinTable();
if ($extra && array_key_exists($field, $extra)) {