mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Check for component before saving, fallback to full form field name
This commit is contained in:
parent
cb05e52b0f
commit
13b81c5e38
@ -475,8 +475,10 @@ class FormField extends RequestHandler
|
|||||||
$component = $record->relObject($relation);
|
$component = $record->relObject($relation);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($fieldName) {
|
if ($fieldName && $component) {
|
||||||
$component->setCastedField($fieldName, $this->dataValue());
|
$component->setCastedField($fieldName, $this->dataValue());
|
||||||
|
} else {
|
||||||
|
$record->setCastedField($this->name, $this->dataValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user