Skip to content

Commit

Permalink
v0.6.1 - Bugfix (#109)
Browse files Browse the repository at this point in the history
* fix: instantiate form fields manually instead of via get_enabled_field_types()

* Version bump
  • Loading branch information
justlevine authored May 18, 2021
1 parent 1df45c5 commit cc4d0d6
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v0.6.1 - Bugfix
- 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
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.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Project Status: Active.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
![Packagist License](https://img.shields.io/packagist/l/harness-software/wp-graphql-gravity-forms?color=green)
![Packagist Version](https://img.shields.io/packagist/v/harness-software/wp-graphql-gravity-forms?label=stable)
![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/harness-software/wp-graphql-gravity-forms/0.6.0)
![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/harness-software/wp-graphql-gravity-forms/0.6.1)
![GitHub forks](https://img.shields.io/github/forks/harness-software/wp-graphql-gravity-forms?style=social)
![GitHub Repo stars](https://img.shields.io/github/stars/harness-software/wp-graphql-gravity-forms?style=social)

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tested up to: 5.7.1
Requires PHP: 7.4
Requires Gravity Forms: 2.4.0+
Requires WPGraphQL: 1.0.0+
Stable tag: 0.6.0
Stable tag: 0.6.1
Maintained at: https://github.com/harness-software/wp-graphql-gravity-forms
License: GPL-3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down
37 changes: 32 additions & 5 deletions src/WPGraphQLGravityForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,38 @@ private function create_instances() : void {
$this->instances['field_interface'] = new GraphQLInterface\FormFieldInterface();

// Fields.
$enabled_field_types = self::get_enabled_field_types();
foreach ( $enabled_field_types as $gf_type => $type ) {
$field_class_name = 'WPGraphQLGravityForms\\Types\\Field\\' . $type;
$this->instances[ $gf_type . '_field' ] = new $field_class_name();
}
$this->instances['address_field'] = new Field\AddressField();
$this->instances['captcha_field'] = new Field\CaptchaField();
$this->instances['chained_select_field'] = new Field\ChainedSelectField();
$this->instances['checkbox_field'] = new Field\CheckboxField();
$this->instances['consent_field'] = new Field\ConsentField();
$this->instances['date_field'] = new Field\DateField();
$this->instances['email_field'] = new Field\EmailField();
$this->instances['file_upload_field'] = new Field\FileUploadField();
$this->instances['hidden_field'] = new Field\HiddenField();
$this->instances['html_field'] = new Field\HtmlField();
$this->instances['list_field'] = new Field\ListField();
$this->instances['multiselect_field'] = new Field\MultiSelectField();
$this->instances['name_field'] = new Field\NameField();
$this->instances['number_field'] = new Field\NumberField();
$this->instances['page_field'] = new Field\PageField();
$this->instances['password_field'] = new Field\PasswordField();
$this->instances['phone_field'] = new Field\PhoneField();
$this->instances['post_category_field'] = new Field\PostCategoryField();
$this->instances['post_content_field'] = new Field\PostContentField();
$this->instances['post_custom_field'] = new Field\PostCustomField();
$this->instances['post_excerpt_field'] = new Field\PostExcerptField();
$this->instances['post_image_field'] = new Field\PostImageField();
$this->instances['post_tags_field'] = new Field\PostTagsField();
$this->instances['post_title_field'] = new Field\PostTitleField();
$this->instances['radio_field'] = new Field\RadioField();
$this->instances['section_field'] = new Field\SectionField();
$this->instances['select_field'] = new Field\SelectField();
$this->instances['signature_field'] = new Field\SignatureField();
$this->instances['textarea_field'] = new Field\TextAreaField();
$this->instances['text_field'] = new Field\TextField();
$this->instances['time_field'] = new Field\TimeField();
$this->instances['website_field'] = new Field\WebsiteField();

// Field Values.
$this->instances['address_field_value'] = new FieldValue\AddressFieldValue();
Expand Down
4 changes: 2 additions & 2 deletions wp-graphql-gravity-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Description: Adds Gravity Forms functionality to the WPGraphQL schema.
* Author: Harness Software
* Author URI: https://www.harnessup.com
* Version: 0.6.0
* Version: 0.6.1
* Text Domain: wp-graphql-gravity-forms
* Domain Path: /languages
* Requires at least: 5.4.1
* Tested up to: 5.7.1
* Tested up to: 5.7.2
* Requires PHP: 7.4
* WPGraphQL requires at least: 1.0.0+
* GravityForms requires at least: 2.4.0+
Expand Down

0 comments on commit cc4d0d6

Please sign in to comment.