mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00:00
FIX Import Closure class for type checking, and only set sort if the sort field exists
This commit is contained in:
parent
37b35f6a46
commit
46b792b27f
@ -3,6 +3,7 @@
|
|||||||
namespace Symbiote\GridFieldExtensions;
|
namespace Symbiote\GridFieldExtensions;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Exception;
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\HTTPRequest;
|
use SilverStripe\Control\HTTPRequest;
|
||||||
use SilverStripe\Control\HTTPResponse_Exception;
|
use SilverStripe\Control\HTTPResponse_Exception;
|
||||||
@ -22,7 +23,6 @@ use SilverStripe\ORM\DataList;
|
|||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
use SilverStripe\ORM\DataObjectInterface;
|
use SilverStripe\ORM\DataObjectInterface;
|
||||||
use SilverStripe\ORM\ManyManyList;
|
use SilverStripe\ORM\ManyManyList;
|
||||||
use Exception;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows inline editing of grid field records without having to load a separate
|
* Allows inline editing of grid field records without having to load a separate
|
||||||
@ -145,7 +145,9 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
|||||||
// Check if we are also sorting these records
|
// Check if we are also sorting these records
|
||||||
if ($sortable) {
|
if ($sortable) {
|
||||||
$sortField = $sortable->getSortField();
|
$sortField = $sortable->getSortField();
|
||||||
$item->setField($sortField, $fields[$sortField]);
|
if (isset($fields[$sortField])) {
|
||||||
|
$item->setField($sortField, $fields[$sortField]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($list instanceof ManyManyList) {
|
if ($list instanceof ManyManyList) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user