Skip to content

Releases: AxeWP/wp-graphql-gravity-forms

v0.7.2.1 - Hotfix

29 Jul 13:04
Compare
Choose a tag to compare

(Re-released, as the last one incorectly contained the old version.)

  • Fixes bug where unset formFields properties would cause a type error for Enums. (h/t @natac13)

v0.7.1 - Bugfix

18 Jul 14:31
df9f271
Compare
Choose a tag to compare

This release fixes the following bugs:

  • fix: Prevents UserError when filtering gravityFormsEntries by a value in any field (i.e. when fieldFilters.key is "0" ).

v0.7.0 - File Uploads and Post Image Submissions 🚀🚀🚀

09 Jul 19:53
8f4acef
Compare
Choose a tag to compare

** ⚠️ This release contains multiple breaking changes. **

The big highlight in this release is experimental*** support for File Upload / Post Image submissions. We also added a feature that updates WordPress post meta when the corresponding Gravity Forms entry is updated.

We added some new WordPress filters, and changed the way some of our PHP classes work, to make it easier for people to add support for their own custom Gravity Forms fields.
We even gave the docs some love. We've added info about filters and using specific form field value inputs, and updated many of the example snippets. You can find the new documnetation in the repo's /docs folder.

Note: These changes did necessitate refactoring many of the plugin classes, so if you're extending any of them in your own projects, make sure to update your class methods!

***: File Uploads and Post Image submissions currently require WPGraphQL Upload to be installed and activated. Once WPGraphQL adds native support for multipart form requests, it is likely that these GraphQL input values will change.

New Features

  • Added support for FileUpload and PostImage field value submissions. Ple
  • Updating Post field values in a Gravity Forms entry, now also updates the corresponding WordPress post. Not even native GF lets you do that!
  • New WordPress filters: wp_graphql_gf_type_config, wp_graphql_gf_connection_config.

Bugfixes

  • chainedSelectValues input is now only visible if the Chained Selects plugin is active.
  • The Entry GraphQL type now implements the wp_graphql_gf_can_view_entries filter.

Under the Hood

  • feat: add altText to PostImage field values.
  • feat: The pageNumber field is now available on all formFields.
  • dev: AbstractEnum::set_values() has been deprecated in favor of AbstractEnum::get_values().
  • dev: Button, LastPageButton, ConditionalLogic, ConditionalLogicRule, Entry, EntryForm, EntryUser, FieldError, Form, FormComfirmation, FormNotification, FormNotificationRouting, FormPagination, SaveAndContinue, now extend AbstractObject`. Their functions have changed accordingly.
  • dev: Added GFUtils::get_gravity_forms_upload_dir() and GUtils::handle_file_upload().
  • dev: Added Utils::maybe_decode_json() and Utils::apply_filters.
  • dev: deprecated wp_graphql_{$enumType}_values filter, in favor of wp_graphql_gf_{$enumType}_values.
  • dev: deprecated wp_graphql_gf_field_types filter, as it no longer necessary to manually map GraphQL fields to GF formFields.
  • dev: deprecated wp_graphql_gf_form_field_instances and wp_graphql_gf_field_value_instances filters in favor of wp_graphql_gf_instances.
  • dev: Deprecated the adminOnly, allowsPrepopulated and inputName fields on PostImageField.
  • dev: Updated composer dependencies.
  • dev!: scr/connections now extend AbstractConnection
  • dev!: src\Types\Input now extend AbstractInput. Their functions have changed accordingly.
  • dev!: Class AbstractField has been deprecated in favor of AbstractFormField. Its functions have changed accordingly.
  • dev!: Classes AbstractProperty, AbstractFieldValue have been deprecated in favor of AbstractObject. Their functions have changed accordingly.
  • dev!: make plugin $instances static for easier access and extension.
  • dev!: The Enum, InputType, ValueProperty PHP interface has been deprecated. Please update your code.
  • dev!: The methods required by the FieldValue, Type PHP interface have changed. Please update your code.
  • tests: Removed testGetEnabledFieldTypes now that we are using static $instances.

v0.6.3 - Unit Tests

04 Jul 15:02
338702d
Compare
Choose a tag to compare
  • Adds support for missing date formats (dmy_dash, dmy_dot, ymd_slash, ymd_dash, and ymd_dot).
  • Fix: EmailInputProperty description updated.
  • Dev: autocompleteAttribute has been deprecated on EmailInputProperty.
  • Tests: Added updateEntry and updateDraftEntry mutations to existing formField tests.
  • Tests: Add tests for CheckboxField, ConsentField, and DateField.

v0.6.2.2 - Hotfix

01 Jul 10:57
36c0ce0
Compare
Choose a tag to compare
  • Fixes submitGravityFormsForm mutation not saving signature field value after v0.6.2.1.

v0.6.2.1 - Hotfix

30 Jun 16:13
e3df1e4
Compare
Choose a tag to compare
  • Fixes updateGravityFormsEntry not saving signature field value.

v0.6.2 - Bugfixes

26 Jun 14:46
28ff329
Compare
Choose a tag to compare

v0.6.2 - Bugfixes

  • Fixes updateGravityFormsEntry mutation not propery saving complex field values (h/t @natac13 )
  • Fixes mutations not correctly deleting old SignatureField files from the server (h/t @natac13 )
  • Fixes SignatureFieldValues failing Gravity Forms isRequired validation (h/t/ @natac13).
  • Fixes empty formFields.layoutGridColumnSpan values not returning as null.
  • Removes deprecation from ChainedSelectInput.name.
  • Correctly sets graphql_connection_max_query_amount to a minimum of 600.
  • AbstractMutation::prepare_field_value_by_type() no longer tries processing unrecognized fields.
  • Dev: Added filter wp_graphql_gf_prepare_field_value for processing custom field values.
  • Dev: Added filter wp_graphql_gf_field_value_type for adding custom field value input types.
  • Dev: The arguments for AbstractMutation::validate_field_value() have changed to no longer require passing the $form. Passing the old set of arguments may stop working in future versions of the plugin.
  • Tests: Added unit tests for ChainedSelect fields and values.

v0.6.1 - Bugfix

18 May 20:26
cc4d0d6
Compare
Choose a tag to compare
  • Fixes a fatal error when adding support for new fields with the wp_graphql_gf_field_types filter.

v0.6.0 - Gravity Forms v2.5 Support

07 May 00:49
1df45c5
Compare
Choose a tag to compare

This release adds support for all the new goodies in Gravity Forms v2.5, squashes a few bugs related to Captcha fields, and refactors the InputProperty on various form fields.

New Features

  • Added customRequiredIndicator, markupVersion, requiredIndicator, validationSummary and version to GravityFormsForm object.
  • Added layoutGridColumnSpan and layoutSpacerGridColumnSpan to formFields interface.
  • Added enableAutocomplete and autocompleteAttribute to AddressField, EmailField ,NameField, NumberField, PhoneField, SelectField, and TextField.
  • Added displayOnly property to CaptchaField.
  • Added allowedExtensions and displayAlt property to PostImageField.
  • Added sort argument for filtering RootQueryToGravityFormsFormConnection. Note: Attempting to sort on GF < v2.5.0.0 will throw a UserError.

Bugfixes

  • [Breaking]: Fixed the captchaTheme enum to use the correct possible values: light and dark.
  • captchaTheme and captchaType now correctly return null when not set by the field.
  • The captchaType enum now has a default value of RECAPTCHA.

Under the hood

  • Refactor various InputProperty classes. InputDefaultValueProperty, InputLabelProperty, and InputplaceholderProperty have been removed for their FieldProperty cousins, and EmailInputProperty is now being used for EmailField.
  • Tests: Clear GFFormDisplay::$submission between individual tests.
  • Tests: Allow overriding the default field factories.
  • Tests: Add tests for CaptchaField.

v0.5.0 - Add Gatsby Support, Email Confirmation, and more!

24 Apr 14:14
4340056
Compare
Choose a tag to compare

** ⚠️ This release contains multiple breaking changes. **

This release moves entry.formField values from edges to nodes, slimming down the query boilerplate and making the plugin compatible with gatsby-source-wordpress. We also added support for submitting an email confirmationValue and retrieving PostImage values, squashed a few bugs, and made the wp_graphql_gf_can_view_entries filter more useful.

We also complete removed the form/entry fields property. All usage should be replaced with formFields.

New features

  • [Breaking] Removed fields from entry and form. Please update your code to use formFields instead.
  • [Breaking] Added support for submitting email confirmation values by using a new input type FieldValuesInput.emailValues.
{
  submitGravityFormsForm(
    input: {
      formId: 1
      clientMutationId: "123abcc"
      fieldValues: [
        {
          id: 1
-         value: "myemail@email.test"
+         emailValues: {
+           value: "myemail@email.test"
+           confirmationValue: "myemail@email.test" # Only necessary if Email confirmation is enabled.
         }
        }
      ]
    }
  )
}
  • [Breaking] The wp_graphql_gf_can_view_entries filter now passes entry_ids instead of field_ids. This lets you do cool things like allowing authenticated users to edit only their own entries:
add_filter(
  'wp_graphql_gf_can_view_entries',
  function( bool $can_view_entries, array $entry_ids ) {
    if ( ! $can_view_entries ) {
      $current_user_id = get_current_user_id();

      // Grab each queried entry and check if the `created_by` id matches the current user id.
      foreach ( $entry_ids as $id ) {
        $entry = GFAPI::get_entry( $id );

        if ( $current_user_id !== (int) $entry['created_by'] ) {
          return false;
        }
      }
    }

    return true;
  },
  10,
  2
);
  • Deprecated formFields.edges.fieldValue in favor of formFields.nodes.{value|typeValues}. Not just does this dramatically slim down the boilerplate needed for your queries, but it also works with gatsby-source-wordpress.
{
  gravityFormsEntry(id: 2977, idType: DATABASE_ID) {
    formFields{
-     edges {
-       fieldValue {
-         ... on TextFieldValue {
-           value
-         }
-         ... on CheckboxFieldValue {
-           checkboxValues {
-             inputId
-             value
-           }
-         }
-         ... on AddressFieldValue {
-           addressValues {
-             street
-             lineTwo
-             city
-             state
-             zip
-             country
-           }
-         }
-       }
-     }
      nodes {
        ... on TextField {
          # Other field properties
+         value
        }
        ... on CheckboxField {
          # Other field properties
+         checkboxValues {
+           inputId
+           value
+         }
        }
        ... on AddressField {
          # Other field properties
+         addressValues {
+           street
+           lineTwo
+           city
+           state
+           zip
+           country
+         }
        }
      }
    }
  }
}
  • Added support for retrieving PostImage field values.

Bugfixes

  • Fixed field ids missing from UpdateDraftEntry{Type}FieldValue errors.
  • Prevented PHP notices about missing entry_id when `submitGravityFormsDraftEntry fails.
  • Prevented UpdateDraftEntry{Type}FieldValue from deleting the previously stored ip.
  • Entry queries now correctly check for gform_full_access permission when gravityforms_edit_entries doesn't exist.
  • Undeprecate InputKeyProperty on name and address fields. Although this is not part of the GF api, it is helpful to associate the inputs with their entry values.

Under the hood

  • Added more unit tests for TextField, TextAreaField, and AddressField.
  • Refactored FieldProperty classes to use AbstractProperty.