diff --git a/src/GridFieldNestedForm.php b/src/GridFieldNestedForm.php index cb3015c..9f4fffc 100644 --- a/src/GridFieldNestedForm.php +++ b/src/GridFieldNestedForm.php @@ -207,6 +207,9 @@ public function augmentColumns($gridField, &$columns) public function getColumnContent($gridField, $record, $columnName) { + if ($gridField->getConfig()->getComponentsByType(GridFieldNestedForm::class)->count() > 1) { + throw new Exception('Only one GridFieldNestedForm component allowed per GridField'); + } if ($this->atMaxNestingLevel($gridField)) { return ''; }