mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00:00
Fix inline editing when no extra fields were defined. Closes #9.
This commit is contained in:
parent
d9e226d8ad
commit
8fc1078437
@ -135,7 +135,7 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
|
||||
$extra = array();
|
||||
|
||||
if($list instanceof ManyManyList) {
|
||||
$extra = array_intersect_key($fields, $list->getExtraFields());
|
||||
$extra = array_intersect_key($fields, (array) $list->getExtraFields());
|
||||
}
|
||||
|
||||
$form->loadDataFrom($fields, Form::MERGE_CLEAR_MISSING);
|
||||
|
@ -73,7 +73,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
$extra = array();
|
||||
|
||||
if($list instanceof ManyManyList) {
|
||||
$extra = array_intersect_key($fields, $list->getExtraFields());
|
||||
$extra = array_intersect_key($fields, (array) $list->getExtraFields());
|
||||
}
|
||||
|
||||
$form->loadDataFrom($fields, Form::MERGE_CLEAR_MISSING);
|
||||
@ -148,7 +148,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
if(!$field && $list instanceof ManyManyList) {
|
||||
$extra = $list->getExtraFields();
|
||||
|
||||
if(array_key_exists($col, $extra)) {
|
||||
if($extra && array_key_exists($col, $extra)) {
|
||||
$field = Object::create_from_string($extra[$col], $col)->scaffoldFormField();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user