From a76f0c116fc51ca20fe72b3507d982fbb7922f2c Mon Sep 17 00:00:00 2001 From: David Levine Date: Wed, 12 Jun 2024 06:58:00 +0000 Subject: [PATCH 1/2] feat: Add `FieldError.connectedFormField` connection --- CHANGELOG.md | 1 + docs/submitting-forms.md | 12 +++++++++-- docs/updating-entries.md | 6 +++++- src/Data/EntryObjectMutation.php | 5 +++-- src/Mutation/SubmitDraftEntry.php | 2 +- src/Mutation/SubmitForm.php | 2 +- src/Type/WPObject/FieldError.php | 20 +++++++++++++++++-- tests/wpunit/AddressFieldTest.php | 12 +++++++++++ tests/wpunit/CaptchaFieldTest.php | 12 +++++++++++ tests/wpunit/ChainedSelectFieldTest.php | 12 +++++++++++ tests/wpunit/CheckboxFieldTest.php | 12 +++++++++++ tests/wpunit/ConsentFieldTest.php | 12 +++++++++++ tests/wpunit/DateFieldTest.php | 12 +++++++++++ tests/wpunit/EmailFieldTest.php | 12 +++++++++++ .../wpunit/EmailFieldWithConfirmationTest.php | 12 +++++++++++ tests/wpunit/FileUploadFieldTest.php | 12 +++++++++++ tests/wpunit/FileUploadMultipleFieldTest.php | 12 +++++++++++ .../FormFieldConnectionPageFilterTest.php | 2 -- tests/wpunit/HiddenFieldTest.php | 12 +++++++++++ tests/wpunit/ListFieldColumnsTest.php | 12 +++++++++++ tests/wpunit/ListFieldTest.php | 12 +++++++++++ tests/wpunit/MultiSelectFieldTest.php | 12 +++++++++++ tests/wpunit/NameFieldTest.php | 12 +++++++++++ tests/wpunit/NumberFieldTest.php | 12 +++++++++++ tests/wpunit/OptionCheckboxFieldTest.php | 12 +++++++++++ tests/wpunit/OptionRadioFieldTest.php | 12 +++++++++++ tests/wpunit/OptionSelectFieldTest.php | 12 +++++++++++ tests/wpunit/PhoneFieldTest.php | 12 +++++++++++ .../wpunit/PostCategoryCheckboxFieldTest.php | 12 +++++++++++ .../PostCategoryMultiSelectFieldTest.php | 12 +++++++++++ tests/wpunit/PostCategoryRadioFieldTest.php | 12 +++++++++++ tests/wpunit/PostCategorySelectFieldTest.php | 12 +++++++++++ tests/wpunit/PostContentFieldTest.php | 12 +++++++++++ tests/wpunit/PostExcerptFieldTest.php | 12 +++++++++++ tests/wpunit/PostImageFieldTest.php | 12 +++++++++++ tests/wpunit/PostTagsCheckboxFieldTest.php | 12 +++++++++++ tests/wpunit/PostTagsMultiSelectFieldTest.php | 12 +++++++++++ tests/wpunit/PostTagsRadioFieldTest.php | 12 +++++++++++ tests/wpunit/PostTagsTextFieldTest.php | 12 +++++++++++ tests/wpunit/PostTitleFieldTest.php | 12 +++++++++++ tests/wpunit/ProductCalculationFieldTest.php | 12 +++++++++++ tests/wpunit/ProductHiddenFieldTest.php | 12 +++++++++++ tests/wpunit/ProductPriceFieldTest.php | 12 +++++++++++ tests/wpunit/ProductRadioFieldTest.php | 12 +++++++++++ tests/wpunit/ProductSelectFieldTest.php | 12 +++++++++++ tests/wpunit/ProductSingleFieldTest.php | 12 +++++++++++ tests/wpunit/QuantityHiddenFieldTest.php | 12 +++++++++++ tests/wpunit/QuantityNumberFieldTest.php | 12 +++++++++++ tests/wpunit/QuantitySelectFieldTest.php | 12 +++++++++++ tests/wpunit/QuizCheckboxFieldTest.php | 12 +++++++++++ tests/wpunit/QuizRadioFieldTest.php | 12 +++++++++++ tests/wpunit/QuizSelectFieldTest.php | 12 +++++++++++ tests/wpunit/RadioFieldOtherChoiceTest.php | 12 +++++++++++ tests/wpunit/RadioFieldTest.php | 12 +++++++++++ tests/wpunit/SelectFieldTest.php | 12 +++++++++++ tests/wpunit/ShippingRadioFieldTest.php | 12 +++++++++++ tests/wpunit/ShippingSelectFieldTest.php | 12 +++++++++++ tests/wpunit/ShippingSingleFieldTest.php | 12 +++++++++++ tests/wpunit/SignatureFieldTest.php | 12 +++++++++++ tests/wpunit/SubmitDraftEntryMutationTest.php | 4 ++++ tests/wpunit/SubmitFormMutationTest.php | 6 ++++++ tests/wpunit/TextAreaFieldTest.php | 12 +++++++++++ tests/wpunit/TextFieldTest.php | 12 +++++++++++ tests/wpunit/TimeFieldTest.php | 12 +++++++++++ tests/wpunit/TotalFieldTest.php | 12 +++++++++++ tests/wpunit/WebsiteFieldTest.php | 12 +++++++++++ 66 files changed, 721 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cbcb6dd..97767b9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - fix!: Keep `PageField` with previous page data when filtering `formFields` by `pageNumber`. H/t @SamuelHadsall . - fix: Handle RadioField submission values when using a custom "other" choice. H/t @Gytjarek . - fix: Check for Submission Confirmation url before attempting to get the associated post ID. +- feat: Add `FieldError.connectedFormField` connection to `FieldError` type. - dev: Use `FormFieldsDataLoader` to resolve fields instead of instantiating a new `Model`. - chore: Add iterable type hints. - chore!: Bump minimum WPGraphQL version to v1.26.0. diff --git a/docs/submitting-forms.md b/docs/submitting-forms.md index 3507997b..5776118e 100644 --- a/docs/submitting-forms.md +++ b/docs/submitting-forms.md @@ -121,8 +121,12 @@ The `fieldValues` input takes an array of objects containing the `id` of the fie url # The redirect URL - if the confirmation type is a "REDIRECT". } errors { - id # The field that failed validation. + id # The field ID that failed validation. message + connectedFormField { # The full FormField object if you need more info. + database + type + } } entry { # See docs on querying Entries. @@ -150,7 +154,11 @@ If the field is NOT updated successfully, such as when a field validation error "errors": [ { "id": "1", - "message": "The text entered exceeds the maximum number of characters." + "message": "The text entered exceeds the maximum number of characters.", + "connectedFormField": { + "database": 1, + "type": "TEXT" + } } ] ``` diff --git a/docs/updating-entries.md b/docs/updating-entries.md index 7074d77a..d6c04071 100644 --- a/docs/updating-entries.md +++ b/docs/updating-entries.md @@ -27,8 +27,12 @@ You can update a [Gravity Forms entry](https://docs.gravityforms.com/entry-objec } ) { errors { - id # The field that failed validation. + id # The field ID that failed validation. message + connectedFormField { # The full FormField object if you need more info. + id + type + } } entry { # See above section on querying Entries. diff --git a/src/Data/EntryObjectMutation.php b/src/Data/EntryObjectMutation.php index 9a3d353a..9e6f3cf1 100644 --- a/src/Data/EntryObjectMutation.php +++ b/src/Data/EntryObjectMutation.php @@ -119,12 +119,13 @@ public static function get_field_value_input( array $args, array $form, bool $is * * @return array{message:string,id:int|string}[] */ - public static function get_submission_errors( array $messages ): array { + public static function get_submission_errors( array $messages, int $form_id ): array { return array_map( - static function ( $id, $message ): array { + static function ( $id, $message ) use ( $form_id ): array { return [ 'id' => $id, 'message' => $message, + 'formId' => $form_id, ]; }, array_keys( $messages ), diff --git a/src/Mutation/SubmitDraftEntry.php b/src/Mutation/SubmitDraftEntry.php index 4d820615..47575c32 100644 --- a/src/Mutation/SubmitDraftEntry.php +++ b/src/Mutation/SubmitDraftEntry.php @@ -106,7 +106,7 @@ public static function mutate_and_get_payload(): callable { return [ 'confirmation' => isset( $result['confirmation_type'] ) ? EntryObjectMutation::get_submission_confirmation( $result ) : null, 'entryId' => ! empty( $result['entry_id'] ) ? absint( $result['entry_id'] ) : null, - 'errors' => isset( $result['validation_messages'] ) ? EntryObjectMutation::get_submission_errors( $result['validation_messages'] ) : null, + 'errors' => isset( $result['validation_messages'] ) ? EntryObjectMutation::get_submission_errors( $result['validation_messages'], (int) $form['id'] ) : null, ]; }; } diff --git a/src/Mutation/SubmitForm.php b/src/Mutation/SubmitForm.php index 6c154285..d79c4106 100644 --- a/src/Mutation/SubmitForm.php +++ b/src/Mutation/SubmitForm.php @@ -165,7 +165,7 @@ public static function mutate_and_get_payload(): callable { return [ 'confirmation' => isset( $submission['confirmation_type'] ) ? EntryObjectMutation::get_submission_confirmation( $submission ) : null, 'entryId' => ! empty( $submission['entry_id'] ) ? absint( $submission['entry_id'] ) : null, - 'errors' => isset( $submission['validation_messages'] ) ? EntryObjectMutation::get_submission_errors( $submission['validation_messages'] ) : null, + 'errors' => isset( $submission['validation_messages'] ) ? EntryObjectMutation::get_submission_errors( $submission['validation_messages'], $form_id ) : null, 'resumeToken' => $submission['resume_token'] ?? null, 'resumeUrl' => isset( $submission['resume_token'] ) ? GFUtils::get_resume_url( $submission['resume_token'], $entry_data['source_url'] ?? '', $form ) : null, 'submission' => $submission, diff --git a/src/Type/WPObject/FieldError.php b/src/Type/WPObject/FieldError.php index 3b1a0c2b..8d570c5a 100644 --- a/src/Type/WPObject/FieldError.php +++ b/src/Type/WPObject/FieldError.php @@ -11,6 +11,9 @@ namespace WPGraphQL\GF\Type\WPObject; +use WPGraphQL\AppContext; +use WPGraphQL\GF\Data\Loader\FormFieldsLoader; +use WPGraphQL\GF\Type\WPInterface\FormField; use WPGraphQL\GF\Type\WPObject\AbstractObject; /** @@ -36,14 +39,27 @@ public static function get_description(): string { */ public static function get_fields(): array { return [ - 'id' => [ + 'id' => [ 'type' => 'Float', 'description' => __( 'The field with the associated error message.', 'wp-graphql-gravity-forms' ), ], - 'message' => [ + 'message' => [ 'type' => 'String', 'description' => __( 'Error message.', 'wp-graphql-gravity-forms' ), ], + 'connectedFormField' => [ + 'type' => FormField::$type, + 'description' => __( 'The form field that the error is connected to.', 'wp-graphql-gravity-forms' ), + 'resolve' => static function ( $source, array $args, AppContext $context ) { + if ( ! isset( $source['id'] ) || ! isset( $source['formId'] ) ) { + return null; + } + + $id_for_loader = (string) $source['formId'] . ':' . (string) $source['id']; + + return $context->get_loader( FormFieldsLoader::$name )->load_deferred( $id_for_loader ); + }, + ], ]; } } diff --git a/tests/wpunit/AddressFieldTest.php b/tests/wpunit/AddressFieldTest.php index 141aa3f9..156399d4 100644 --- a/tests/wpunit/AddressFieldTest.php +++ b/tests/wpunit/AddressFieldTest.php @@ -177,6 +177,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -215,6 +219,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -247,6 +255,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/CaptchaFieldTest.php b/tests/wpunit/CaptchaFieldTest.php index b619d23c..a8251f4e 100644 --- a/tests/wpunit/CaptchaFieldTest.php +++ b/tests/wpunit/CaptchaFieldTest.php @@ -182,6 +182,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields(where:{fieldTypes:TEXT}) { @@ -213,6 +217,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -238,6 +246,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields (where:{fieldTypes:TEXT}){ diff --git a/tests/wpunit/ChainedSelectFieldTest.php b/tests/wpunit/ChainedSelectFieldTest.php index 823ff1f3..f32e69fa 100644 --- a/tests/wpunit/ChainedSelectFieldTest.php +++ b/tests/wpunit/ChainedSelectFieldTest.php @@ -198,6 +198,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -229,6 +233,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -254,6 +262,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/CheckboxFieldTest.php b/tests/wpunit/CheckboxFieldTest.php index 37a157dd..dd3c80b5 100644 --- a/tests/wpunit/CheckboxFieldTest.php +++ b/tests/wpunit/CheckboxFieldTest.php @@ -258,6 +258,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -307,6 +311,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -336,6 +344,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ConsentFieldTest.php b/tests/wpunit/ConsentFieldTest.php index b47be0aa..07a05b02 100644 --- a/tests/wpunit/ConsentFieldTest.php +++ b/tests/wpunit/ConsentFieldTest.php @@ -152,6 +152,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -183,6 +187,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -208,6 +216,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/DateFieldTest.php b/tests/wpunit/DateFieldTest.php index 5045794f..c01ec06b 100644 --- a/tests/wpunit/DateFieldTest.php +++ b/tests/wpunit/DateFieldTest.php @@ -142,6 +142,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -173,6 +177,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -198,6 +206,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/EmailFieldTest.php b/tests/wpunit/EmailFieldTest.php index f4d1fd97..662b0014 100644 --- a/tests/wpunit/EmailFieldTest.php +++ b/tests/wpunit/EmailFieldTest.php @@ -186,6 +186,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -217,6 +221,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -242,6 +250,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/EmailFieldWithConfirmationTest.php b/tests/wpunit/EmailFieldWithConfirmationTest.php index 69f2472e..00041ea3 100644 --- a/tests/wpunit/EmailFieldWithConfirmationTest.php +++ b/tests/wpunit/EmailFieldWithConfirmationTest.php @@ -191,6 +191,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -222,6 +226,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -247,6 +255,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/FileUploadFieldTest.php b/tests/wpunit/FileUploadFieldTest.php index 06fe9dde..6edda65b 100644 --- a/tests/wpunit/FileUploadFieldTest.php +++ b/tests/wpunit/FileUploadFieldTest.php @@ -235,6 +235,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -270,6 +274,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -299,6 +307,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/FileUploadMultipleFieldTest.php b/tests/wpunit/FileUploadMultipleFieldTest.php index 4d619a23..6fad76d6 100644 --- a/tests/wpunit/FileUploadMultipleFieldTest.php +++ b/tests/wpunit/FileUploadMultipleFieldTest.php @@ -246,6 +246,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -281,6 +285,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -310,6 +318,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/FormFieldConnectionPageFilterTest.php b/tests/wpunit/FormFieldConnectionPageFilterTest.php index deb20f0c..db1b7e24 100644 --- a/tests/wpunit/FormFieldConnectionPageFilterTest.php +++ b/tests/wpunit/FormFieldConnectionPageFilterTest.php @@ -135,8 +135,6 @@ public function testFilterByPageNumber(): void { $form = GFAPI::get_form( $this->form_id ); $wp_query = $form['fields']; - error_log( print_r( $wp_query, true ) ); - /** * Test with empty offset. */ diff --git a/tests/wpunit/HiddenFieldTest.php b/tests/wpunit/HiddenFieldTest.php index ac10c2e0..5aaad9dc 100644 --- a/tests/wpunit/HiddenFieldTest.php +++ b/tests/wpunit/HiddenFieldTest.php @@ -112,6 +112,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -143,6 +147,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -169,6 +177,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ListFieldColumnsTest.php b/tests/wpunit/ListFieldColumnsTest.php index ce7a0e3b..e6e1ac6e 100644 --- a/tests/wpunit/ListFieldColumnsTest.php +++ b/tests/wpunit/ListFieldColumnsTest.php @@ -208,6 +208,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -241,6 +245,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -268,6 +276,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ListFieldTest.php b/tests/wpunit/ListFieldTest.php index 16545c02..2c6fcd61 100644 --- a/tests/wpunit/ListFieldTest.php +++ b/tests/wpunit/ListFieldTest.php @@ -168,6 +168,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -201,6 +205,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -228,6 +236,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/MultiSelectFieldTest.php b/tests/wpunit/MultiSelectFieldTest.php index 0e176428..10474011 100644 --- a/tests/wpunit/MultiSelectFieldTest.php +++ b/tests/wpunit/MultiSelectFieldTest.php @@ -140,6 +140,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -171,6 +175,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -196,6 +204,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/NameFieldTest.php b/tests/wpunit/NameFieldTest.php index d88d2143..d933e99b 100644 --- a/tests/wpunit/NameFieldTest.php +++ b/tests/wpunit/NameFieldTest.php @@ -176,6 +176,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -213,6 +217,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -244,6 +252,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/NumberFieldTest.php b/tests/wpunit/NumberFieldTest.php index e0f8f5f3..a8659579 100644 --- a/tests/wpunit/NumberFieldTest.php +++ b/tests/wpunit/NumberFieldTest.php @@ -139,6 +139,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -170,6 +174,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -195,6 +203,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/OptionCheckboxFieldTest.php b/tests/wpunit/OptionCheckboxFieldTest.php index c6172b0f..779746af 100644 --- a/tests/wpunit/OptionCheckboxFieldTest.php +++ b/tests/wpunit/OptionCheckboxFieldTest.php @@ -339,6 +339,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -390,6 +394,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -420,6 +428,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/OptionRadioFieldTest.php b/tests/wpunit/OptionRadioFieldTest.php index 4c4e086d..36a83e1d 100644 --- a/tests/wpunit/OptionRadioFieldTest.php +++ b/tests/wpunit/OptionRadioFieldTest.php @@ -198,6 +198,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -229,6 +233,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -255,6 +263,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/OptionSelectFieldTest.php b/tests/wpunit/OptionSelectFieldTest.php index cd940aaf..378f5e80 100644 --- a/tests/wpunit/OptionSelectFieldTest.php +++ b/tests/wpunit/OptionSelectFieldTest.php @@ -208,6 +208,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -239,6 +243,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -265,6 +273,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PhoneFieldTest.php b/tests/wpunit/PhoneFieldTest.php index 187b6d46..731f9241 100644 --- a/tests/wpunit/PhoneFieldTest.php +++ b/tests/wpunit/PhoneFieldTest.php @@ -134,6 +134,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -165,6 +169,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -190,6 +198,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostCategoryCheckboxFieldTest.php b/tests/wpunit/PostCategoryCheckboxFieldTest.php index d3aa2648..0b2f316f 100644 --- a/tests/wpunit/PostCategoryCheckboxFieldTest.php +++ b/tests/wpunit/PostCategoryCheckboxFieldTest.php @@ -366,6 +366,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -415,6 +419,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -444,6 +452,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostCategoryMultiSelectFieldTest.php b/tests/wpunit/PostCategoryMultiSelectFieldTest.php index ea1dad20..1fcf8984 100644 --- a/tests/wpunit/PostCategoryMultiSelectFieldTest.php +++ b/tests/wpunit/PostCategoryMultiSelectFieldTest.php @@ -210,6 +210,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -241,6 +245,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -266,6 +274,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostCategoryRadioFieldTest.php b/tests/wpunit/PostCategoryRadioFieldTest.php index 19bc23d8..b72cc20d 100644 --- a/tests/wpunit/PostCategoryRadioFieldTest.php +++ b/tests/wpunit/PostCategoryRadioFieldTest.php @@ -200,6 +200,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -231,6 +235,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -256,6 +264,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostCategorySelectFieldTest.php b/tests/wpunit/PostCategorySelectFieldTest.php index 2dc80217..d0a1e7b3 100644 --- a/tests/wpunit/PostCategorySelectFieldTest.php +++ b/tests/wpunit/PostCategorySelectFieldTest.php @@ -203,6 +203,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -234,6 +238,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -259,6 +267,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostContentFieldTest.php b/tests/wpunit/PostContentFieldTest.php index 4f2f22db..bc02bf3e 100644 --- a/tests/wpunit/PostContentFieldTest.php +++ b/tests/wpunit/PostContentFieldTest.php @@ -132,6 +132,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -163,6 +167,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -188,6 +196,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostExcerptFieldTest.php b/tests/wpunit/PostExcerptFieldTest.php index c09bffe0..3a6653a7 100644 --- a/tests/wpunit/PostExcerptFieldTest.php +++ b/tests/wpunit/PostExcerptFieldTest.php @@ -130,6 +130,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -161,6 +165,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -186,6 +194,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostImageFieldTest.php b/tests/wpunit/PostImageFieldTest.php index b5d687c1..689c3697 100644 --- a/tests/wpunit/PostImageFieldTest.php +++ b/tests/wpunit/PostImageFieldTest.php @@ -271,6 +271,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -309,6 +313,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -341,6 +349,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostTagsCheckboxFieldTest.php b/tests/wpunit/PostTagsCheckboxFieldTest.php index 285d5738..a455aab6 100644 --- a/tests/wpunit/PostTagsCheckboxFieldTest.php +++ b/tests/wpunit/PostTagsCheckboxFieldTest.php @@ -292,6 +292,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -327,6 +331,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -356,6 +364,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostTagsMultiSelectFieldTest.php b/tests/wpunit/PostTagsMultiSelectFieldTest.php index fa4e9759..68aadf0d 100644 --- a/tests/wpunit/PostTagsMultiSelectFieldTest.php +++ b/tests/wpunit/PostTagsMultiSelectFieldTest.php @@ -212,6 +212,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -243,6 +247,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -268,6 +276,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostTagsRadioFieldTest.php b/tests/wpunit/PostTagsRadioFieldTest.php index 4c05917c..7a7a4b50 100644 --- a/tests/wpunit/PostTagsRadioFieldTest.php +++ b/tests/wpunit/PostTagsRadioFieldTest.php @@ -202,6 +202,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -233,6 +237,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -258,6 +266,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostTagsTextFieldTest.php b/tests/wpunit/PostTagsTextFieldTest.php index 19ba17fd..dc211515 100644 --- a/tests/wpunit/PostTagsTextFieldTest.php +++ b/tests/wpunit/PostTagsTextFieldTest.php @@ -168,6 +168,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -199,6 +203,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -224,6 +232,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/PostTitleFieldTest.php b/tests/wpunit/PostTitleFieldTest.php index ed733132..cf2f9062 100644 --- a/tests/wpunit/PostTitleFieldTest.php +++ b/tests/wpunit/PostTitleFieldTest.php @@ -130,6 +130,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -161,6 +165,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -186,6 +194,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ProductCalculationFieldTest.php b/tests/wpunit/ProductCalculationFieldTest.php index 39a5e9ce..da75314c 100644 --- a/tests/wpunit/ProductCalculationFieldTest.php +++ b/tests/wpunit/ProductCalculationFieldTest.php @@ -194,6 +194,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -229,6 +233,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -258,6 +266,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ProductHiddenFieldTest.php b/tests/wpunit/ProductHiddenFieldTest.php index 08d1b522..9b9850fa 100644 --- a/tests/wpunit/ProductHiddenFieldTest.php +++ b/tests/wpunit/ProductHiddenFieldTest.php @@ -177,6 +177,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -212,6 +216,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -241,6 +249,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ProductPriceFieldTest.php b/tests/wpunit/ProductPriceFieldTest.php index 1fe65da8..2cc59ef2 100644 --- a/tests/wpunit/ProductPriceFieldTest.php +++ b/tests/wpunit/ProductPriceFieldTest.php @@ -158,6 +158,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -193,6 +197,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -222,6 +230,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ProductRadioFieldTest.php b/tests/wpunit/ProductRadioFieldTest.php index 8432b29d..8fee7d3a 100644 --- a/tests/wpunit/ProductRadioFieldTest.php +++ b/tests/wpunit/ProductRadioFieldTest.php @@ -190,6 +190,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -225,6 +229,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -254,6 +262,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ProductSelectFieldTest.php b/tests/wpunit/ProductSelectFieldTest.php index cbc5d4b1..733c63c6 100644 --- a/tests/wpunit/ProductSelectFieldTest.php +++ b/tests/wpunit/ProductSelectFieldTest.php @@ -195,6 +195,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -230,6 +234,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -259,6 +267,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ProductSingleFieldTest.php b/tests/wpunit/ProductSingleFieldTest.php index 2e9ce79b..04580bcd 100644 --- a/tests/wpunit/ProductSingleFieldTest.php +++ b/tests/wpunit/ProductSingleFieldTest.php @@ -187,6 +187,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -222,6 +226,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -251,6 +259,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/QuantityHiddenFieldTest.php b/tests/wpunit/QuantityHiddenFieldTest.php index d735badb..f4557d8d 100644 --- a/tests/wpunit/QuantityHiddenFieldTest.php +++ b/tests/wpunit/QuantityHiddenFieldTest.php @@ -183,6 +183,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -214,6 +218,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -240,6 +248,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/QuantityNumberFieldTest.php b/tests/wpunit/QuantityNumberFieldTest.php index 2df17d7a..83ac8d0e 100644 --- a/tests/wpunit/QuantityNumberFieldTest.php +++ b/tests/wpunit/QuantityNumberFieldTest.php @@ -202,6 +202,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -233,6 +237,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -259,6 +267,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/QuantitySelectFieldTest.php b/tests/wpunit/QuantitySelectFieldTest.php index b9fbb4eb..c516c05e 100644 --- a/tests/wpunit/QuantitySelectFieldTest.php +++ b/tests/wpunit/QuantitySelectFieldTest.php @@ -233,6 +233,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -264,6 +268,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -290,6 +298,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/QuizCheckboxFieldTest.php b/tests/wpunit/QuizCheckboxFieldTest.php index c002a55c..c5b268a5 100644 --- a/tests/wpunit/QuizCheckboxFieldTest.php +++ b/tests/wpunit/QuizCheckboxFieldTest.php @@ -287,6 +287,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -322,6 +326,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -351,6 +359,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/QuizRadioFieldTest.php b/tests/wpunit/QuizRadioFieldTest.php index 40d7741d..65a1649e 100644 --- a/tests/wpunit/QuizRadioFieldTest.php +++ b/tests/wpunit/QuizRadioFieldTest.php @@ -197,6 +197,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -228,6 +232,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -253,6 +261,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/QuizSelectFieldTest.php b/tests/wpunit/QuizSelectFieldTest.php index 59acd2cb..60910d13 100644 --- a/tests/wpunit/QuizSelectFieldTest.php +++ b/tests/wpunit/QuizSelectFieldTest.php @@ -188,6 +188,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -219,6 +223,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -244,6 +252,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/RadioFieldOtherChoiceTest.php b/tests/wpunit/RadioFieldOtherChoiceTest.php index 537d540b..7b8342b7 100644 --- a/tests/wpunit/RadioFieldOtherChoiceTest.php +++ b/tests/wpunit/RadioFieldOtherChoiceTest.php @@ -142,6 +142,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -173,6 +177,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -198,6 +206,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/RadioFieldTest.php b/tests/wpunit/RadioFieldTest.php index 201ca8ef..958e92a4 100644 --- a/tests/wpunit/RadioFieldTest.php +++ b/tests/wpunit/RadioFieldTest.php @@ -135,6 +135,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -166,6 +170,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -191,6 +199,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/SelectFieldTest.php b/tests/wpunit/SelectFieldTest.php index c93f4790..4c550967 100644 --- a/tests/wpunit/SelectFieldTest.php +++ b/tests/wpunit/SelectFieldTest.php @@ -140,6 +140,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -171,6 +175,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -196,6 +204,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ShippingRadioFieldTest.php b/tests/wpunit/ShippingRadioFieldTest.php index e599d900..aa650680 100644 --- a/tests/wpunit/ShippingRadioFieldTest.php +++ b/tests/wpunit/ShippingRadioFieldTest.php @@ -171,6 +171,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -202,6 +206,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -227,6 +235,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ShippingSelectFieldTest.php b/tests/wpunit/ShippingSelectFieldTest.php index 11604c83..a2f42384 100644 --- a/tests/wpunit/ShippingSelectFieldTest.php +++ b/tests/wpunit/ShippingSelectFieldTest.php @@ -177,6 +177,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -208,6 +212,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -233,6 +241,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/ShippingSingleFieldTest.php b/tests/wpunit/ShippingSingleFieldTest.php index 12d2d12c..021ea955 100644 --- a/tests/wpunit/ShippingSingleFieldTest.php +++ b/tests/wpunit/ShippingSingleFieldTest.php @@ -127,6 +127,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -158,6 +162,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -183,6 +191,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/SignatureFieldTest.php b/tests/wpunit/SignatureFieldTest.php index e99cb404..adee8638 100644 --- a/tests/wpunit/SignatureFieldTest.php +++ b/tests/wpunit/SignatureFieldTest.php @@ -140,6 +140,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -171,6 +175,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -196,6 +204,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/SubmitDraftEntryMutationTest.php b/tests/wpunit/SubmitDraftEntryMutationTest.php index 1f137dc6..e9e55cef 100644 --- a/tests/wpunit/SubmitDraftEntryMutationTest.php +++ b/tests/wpunit/SubmitDraftEntryMutationTest.php @@ -187,6 +187,10 @@ public function submit_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } confirmation { message diff --git a/tests/wpunit/SubmitFormMutationTest.php b/tests/wpunit/SubmitFormMutationTest.php index 81ccc614..f1cc2850 100644 --- a/tests/wpunit/SubmitFormMutationTest.php +++ b/tests/wpunit/SubmitFormMutationTest.php @@ -55,6 +55,8 @@ public function testSubmitFormWithEmptyFieldValues(): void { $this->assertCount( 1, $actual['data']['submitGfForm']['errors'] ); $this->assertNotEmpty( $actual['data']['submitGfForm']['errors'][0]['id'] ); $this->assertNotEmpty( $actual['data']['submitGfForm']['errors'][0]['message'] ); + $this->assertNotEmpty( $actual['data']['submitGfForm']['errors'][0]['connectedFormField'] ); + $this->assertEquals( $actual['data']['submitGfForm']['errors'][0]['id'], $actual['data']['submitGfForm']['errors'][0]['connectedFormField']['databaseId'] ); } public function testSubmitForm(): void { @@ -827,6 +829,10 @@ public function submit_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } resumeUrl } diff --git a/tests/wpunit/TextAreaFieldTest.php b/tests/wpunit/TextAreaFieldTest.php index 436692e9..c3d9abb4 100644 --- a/tests/wpunit/TextAreaFieldTest.php +++ b/tests/wpunit/TextAreaFieldTest.php @@ -133,6 +133,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -164,6 +168,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -189,6 +197,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/TextFieldTest.php b/tests/wpunit/TextFieldTest.php index 13af5514..04456b48 100644 --- a/tests/wpunit/TextFieldTest.php +++ b/tests/wpunit/TextFieldTest.php @@ -136,6 +136,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -167,6 +171,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -192,6 +200,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/TimeFieldTest.php b/tests/wpunit/TimeFieldTest.php index 6fddbebf..5608cf57 100644 --- a/tests/wpunit/TimeFieldTest.php +++ b/tests/wpunit/TimeFieldTest.php @@ -160,6 +160,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -196,6 +200,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -226,6 +234,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/TotalFieldTest.php b/tests/wpunit/TotalFieldTest.php index 1f648401..2a371f97 100644 --- a/tests/wpunit/TotalFieldTest.php +++ b/tests/wpunit/TotalFieldTest.php @@ -176,6 +176,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -210,6 +214,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -239,6 +247,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { diff --git a/tests/wpunit/WebsiteFieldTest.php b/tests/wpunit/WebsiteFieldTest.php index ab0dd272..fb40c201 100644 --- a/tests/wpunit/WebsiteFieldTest.php +++ b/tests/wpunit/WebsiteFieldTest.php @@ -130,6 +130,10 @@ public function submit_form_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -161,6 +165,10 @@ public function update_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry { formFields { @@ -186,6 +194,10 @@ public function update_draft_entry_mutation(): string { errors { id message + connectedFormField { + databaseId + type + } } entry: draftEntry { formFields { From 20d7efb5f4712e02be0dc0db347c88cdc08d8753 Mon Sep 17 00:00:00 2001 From: David Levine Date: Wed, 12 Jun 2024 07:02:41 +0000 Subject: [PATCH 2/2] chore: add missing param to docblock --- src/Data/EntryObjectMutation.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Data/EntryObjectMutation.php b/src/Data/EntryObjectMutation.php index 9e6f3cf1..7a034fd4 100644 --- a/src/Data/EntryObjectMutation.php +++ b/src/Data/EntryObjectMutation.php @@ -116,6 +116,7 @@ public static function get_field_value_input( array $args, array $form, bool $is * Generates array of field errors from the submission. * * @param array $messages The Gravity Forms submission validation messages. + * @param int $form_id The ID of the form. * * @return array{message:string,id:int|string}[] */