Throw an exception in Nesed Gridfield if an invalid relation is configured.

This commit is contained in:
Niklas Forsdahl 2024-05-07 12:36:44 +03:00
parent 1993acba3a
commit 9ab3ed67a7

View File

@ -215,7 +215,7 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements
$this->gridField = $gridField;
$relationName = $this->getRelationName();
if (!$record->hasMethod($relationName)) {
return '';
throw new Exception('Invalid relation name');
}
if ($this->canExpandCallback) {
if (is_callable($this->canExpandCallback)