mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
parent
796bd0ad68
commit
6727eb3a1d
@ -140,13 +140,13 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
|
|||||||
$item = $class::create();
|
$item = $class::create();
|
||||||
$extra = array();
|
$extra = array();
|
||||||
|
|
||||||
if($list instanceof ManyManyList) {
|
|
||||||
$extra = array_intersect_key($fields, (array) $list->getExtraFields());
|
|
||||||
}
|
|
||||||
|
|
||||||
$form->loadDataFrom($fields, Form::MERGE_CLEAR_MISSING);
|
$form->loadDataFrom($fields, Form::MERGE_CLEAR_MISSING);
|
||||||
$form->saveInto($item);
|
$form->saveInto($item);
|
||||||
|
|
||||||
|
if($list instanceof ManyManyList) {
|
||||||
|
$extra = array_intersect_key($form->getData(), (array) $list->getExtraFields());
|
||||||
|
}
|
||||||
|
|
||||||
$item->write();
|
$item->write();
|
||||||
$list->add($item, $extra);
|
$list->add($item, $extra);
|
||||||
}
|
}
|
||||||
|
@ -76,13 +76,13 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
|||||||
|
|
||||||
$extra = array();
|
$extra = array();
|
||||||
|
|
||||||
if($list instanceof ManyManyList) {
|
|
||||||
$extra = array_intersect_key($fields, (array) $list->getExtraFields());
|
|
||||||
}
|
|
||||||
|
|
||||||
$form->loadDataFrom($fields, Form::MERGE_CLEAR_MISSING);
|
$form->loadDataFrom($fields, Form::MERGE_CLEAR_MISSING);
|
||||||
$form->saveInto($item);
|
$form->saveInto($item);
|
||||||
|
|
||||||
|
if($list instanceof ManyManyList) {
|
||||||
|
$extra = array_intersect_key($form->getData(), (array) $list->getExtraFields());
|
||||||
|
}
|
||||||
|
|
||||||
$item->write();
|
$item->write();
|
||||||
$list->add($item, $extra);
|
$list->add($item, $extra);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user