diff --git a/modules/tide_webform_jsonapi/src/Resource/AddWebform.php b/modules/tide_webform_jsonapi/src/TideResource/AddWebform.php similarity index 99% rename from modules/tide_webform_jsonapi/src/Resource/AddWebform.php rename to modules/tide_webform_jsonapi/src/TideResource/AddWebform.php index 8c1af4d..d4475ed 100644 --- a/modules/tide_webform_jsonapi/src/Resource/AddWebform.php +++ b/modules/tide_webform_jsonapi/src/TideResource/AddWebform.php @@ -1,6 +1,6 @@ $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.']; diff --git a/modules/tide_webform_jsonapi/tide_webform_jsonapi.info.yml b/modules/tide_webform_jsonapi/tide_webform_jsonapi.info.yml index b256ceb..24c013b 100644 --- a/modules/tide_webform_jsonapi/tide_webform_jsonapi.info.yml +++ b/modules/tide_webform_jsonapi/tide_webform_jsonapi.info.yml @@ -1,6 +1,6 @@ name: 'JSON:API Tide_webform' description: "This module let's you validate payload for webform." -core_version_requirement: ^9 || ^10 +core_version_requirement: ^9.5 || ^10 type: module dependencies: - drupal:jsonapi_resources diff --git a/modules/tide_webform_jsonapi/tide_webform_jsonapi.routing.yml b/modules/tide_webform_jsonapi/tide_webform_jsonapi.routing.yml index c972f9e..71115c1 100644 --- a/modules/tide_webform_jsonapi/tide_webform_jsonapi.routing.yml +++ b/modules/tide_webform_jsonapi/tide_webform_jsonapi.routing.yml @@ -2,10 +2,10 @@ tide_webform_jsonapi.add_webform: path: '/%jsonapi%/webform/{webform}/add' methods: ['POST'] defaults: - _jsonapi_resource: Drupal\tide_webform_jsonapi\Resource\AddWebform + _jsonapi_resource: Drupal\tide_webform_jsonapi\TideResource\AddWebform requirements: _permission: 'access content' options: parameters: webform: - type: 'entity:webform' \ No newline at end of file + type: 'entity:webform'