From e326d0052f4821ab382129c14293b01c362c5194 Mon Sep 17 00:00:00 2001 From: Vincent Gao Date: Mon, 5 Jun 2023 13:36:01 +1000 Subject: [PATCH] update --- modules/tide_webform_jsonapi/src/TideWebformJsonapiHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.'];