mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge pull request #372 from creative-commoners/pulls/3.6/manymanythrough-editablecolumns
FIX Allow editing extra fields from ManyManyThroughList.
This commit is contained in:
commit
e7d7178719
@ -24,6 +24,7 @@ use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\DataObjectInterface;
|
||||
use SilverStripe\ORM\ManyManyList;
|
||||
use SilverStripe\ORM\ManyManyThroughList;
|
||||
|
||||
/**
|
||||
* Allows inline editing of grid field records without having to load a separate
|
||||
@ -165,7 +166,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
}
|
||||
}
|
||||
|
||||
if ($list instanceof ManyManyList) {
|
||||
if ($list instanceof ManyManyList || $list instanceof ManyManyThroughList) {
|
||||
$extra = array_intersect_key($form->getData() ?? [], (array) $list->getExtraFields());
|
||||
}
|
||||
|
||||
@ -250,7 +251,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
}
|
||||
}
|
||||
|
||||
if (!$field && $list instanceof ManyManyList) {
|
||||
if (!$field && ($list instanceof ManyManyList || $list instanceof ManyManyThroughList)) {
|
||||
$extra = $list->getExtraFields();
|
||||
|
||||
if ($extra && array_key_exists($col, $extra ?? [])) {
|
||||
|
Loading…
Reference in New Issue
Block a user