diff --git a/modules/tide_webform_jsonapi/src/TideWebformJsonapiHelper.php b/modules/tide_webform_jsonapi/src/TideWebformJsonapiHelper.php index 21e1ba6..cc0834d 100644 --- a/modules/tide_webform_jsonapi/src/TideWebformJsonapiHelper.php +++ b/modules/tide_webform_jsonapi/src/TideWebformJsonapiHelper.php @@ -90,7 +90,7 @@ public function validatePayload(array $payload, array $massaged_validates_array, } // 3rd step, check if the field contains correct email or phone numbers. foreach ($original_elements as $field_id => $detail) { - if (!isset($results[$field_id])) { + if (!isset($results[$field_id]) && isset($payload[$field_id])) { if ($detail['#type'] === 'email') { if (v::email()->validate($payload[$field_id]) === FALSE) { $results[$field_id] = ['Please provide a valid email address.'];