mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00:00
Only allow one GridFieldNestedForm component per GridField.
This commit is contained in:
parent
c476cedff0
commit
a42cd43780
@ -207,6 +207,9 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements
|
||||
|
||||
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 '';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user