Skip to content

Commit e7d7178

Browse files
authored
Merge pull request #372 from creative-commoners/pulls/3.6/manymanythrough-editablecolumns
FIX Allow editing extra fields from ManyManyThroughList.
2 parents 1e5a1e8 + 47171ee commit e7d7178

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/GridFieldEditableColumns.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use SilverStripe\ORM\DataObject;
2525
use SilverStripe\ORM\DataObjectInterface;
2626
use SilverStripe\ORM\ManyManyList;
27+
use SilverStripe\ORM\ManyManyThroughList;
2728

2829
/**
2930
* Allows inline editing of grid field records without having to load a separate
@@ -165,7 +166,7 @@ public function handleSave(GridField $grid, DataObjectInterface $record)
165166
}
166167
}
167168

168-
if ($list instanceof ManyManyList) {
169+
if ($list instanceof ManyManyList || $list instanceof ManyManyThroughList) {
169170
$extra = array_intersect_key($form->getData() ?? [], (array) $list->getExtraFields());
170171
}
171172

@@ -250,7 +251,7 @@ public function getFields(GridField $grid, DataObjectInterface $record)
250251
}
251252
}
252253

253-
if (!$field && $list instanceof ManyManyList) {
254+
if (!$field && ($list instanceof ManyManyList || $list instanceof ManyManyThroughList)) {
254255
$extra = $list->getExtraFields();
255256

256257
if ($extra && array_key_exists($col, $extra ?? [])) {

0 commit comments

Comments
 (0)