From 13b81c5e386958cb919f0469771e58216bc7daca Mon Sep 17 00:00:00 2001 From: Tyler Date: Tue, 5 Apr 2022 14:39:23 -0400 Subject: [PATCH] Check for component before saving, fallback to full form field name --- src/Forms/FormField.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Forms/FormField.php b/src/Forms/FormField.php index ecd9ede9a..e266325cb 100644 --- a/src/Forms/FormField.php +++ b/src/Forms/FormField.php @@ -475,8 +475,10 @@ class FormField extends RequestHandler $component = $record->relObject($relation); } - if ($fieldName) { + if ($fieldName && $component) { $component->setCastedField($fieldName, $this->dataValue()); + } else { + $record->setCastedField($this->name, $this->dataValue()); } }