diff --git a/src/GridFieldNestedFormItemRequest.php b/src/GridFieldNestedFormItemRequest.php index cf52867..fdd104a 100644 --- a/src/GridFieldNestedFormItemRequest.php +++ b/src/GridFieldNestedFormItemRequest.php @@ -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());