mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Only add nested form to nested gridfield child if that child is of
the same class as the parent record.
This commit is contained in:
parent
9ab3ed67a7
commit
8f505659f0
@ -73,7 +73,7 @@ class GridFieldNestedFormItemRequest extends GridFieldDetailForm_ItemRequest
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->record->hasExtension(Hierarchy::class)) {
|
||||
if ($this->record->hasExtension(Hierarchy::class) && $relationClass == get_class($this->record)) {
|
||||
$config->addComponent($nestedForm = new GridFieldNestedForm(), GridFieldOrderableRows::class);
|
||||
// use max nesting level from parent component
|
||||
$nestedForm->setMaxNestingLevel($this->component->getMaxNestingLevel());
|
||||
|
Loading…
Reference in New Issue
Block a user