Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #259 from wp-graphql/release/v0.5.2
Browse files Browse the repository at this point in the history
Release/v0.5.2
  • Loading branch information
jasonbahl authored Apr 28, 2021
2 parents c2120f6 + a5077f2 commit 87fb6ec
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 15 deletions.
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://wpgraphql.com/acf
Tags: WPGraphQL, GraphQL, API, Advanced Custom Fields, ACF
Requires at least: 5.0
Tested up to: 5.1.1
Stable tag: 0.5.0
Stable tag: 0.5.2
License: GPL-3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
1 change: 1 addition & 0 deletions src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ protected function add_options_pages_to_schema() {

$field_name = Utils::format_field_name( $type_name );

$options_page['type'] = 'options_page';
$this->type_registry->register_field(
'RootQuery',
$field_name,
Expand Down
40 changes: 40 additions & 0 deletions tests/wpunit/LocationRulesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,33 @@ public function register_acf_field_group( $config = [] ) {

}

public function register_acf_field( $config = [] ) {

$defaults = [
'parent' => $this->group_key,
'key' => 'field_5d7812fd123',
'label' => 'Text',
'name' => 'text',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'show_in_graphql' => 1,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
];

acf_add_local_field( array_merge( $defaults, $config ) );
}

public function testFieldGroupAssignedToPostTypeWithoutGraphqlTypesFieldShowsInSchema() {

/**
Expand Down Expand Up @@ -615,6 +642,16 @@ public function testFieldGroupAssignedToAcfOptionsPageShowsInSchema() {
'graphql_field_name' => 'settingsFieldsTest',
]);

$this->register_acf_field([
'parent' => 'settingsFieldsTest',
'name' => 'text',
'key' => 'settingsFieldTextField'
]);

$expected = 'this is a test value for the settings field';

update_field( 'settingsFieldTextField', $expected, 'option' );

acf_add_options_page(array(
'page_title' => 'Theme General Settings',
'menu_title' => 'Theme Settings',
Expand Down Expand Up @@ -649,11 +686,13 @@ public function testFieldGroupAssignedToAcfOptionsPageShowsInSchema() {
themeGeneralSettings {
settingsFieldsTest {
__typename
text
}
}
themeFooterSettings {
settingsFieldsTest {
__typename
text
}
}
}
Expand All @@ -666,6 +705,7 @@ public function testFieldGroupAssignedToAcfOptionsPageShowsInSchema() {
codecept_debug( $actual );

$this->assertArrayNotHasKey( 'errors', $actual );
$this->assertSame( $expected, $actual['data']['themeGeneralSettings']['settingsFieldsTest']['text'] );

acf_remove_local_field_group( 'settingsFieldsTest' );

Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ class InstalledVersions
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '1bad7d6d5214448f8d27bbcd908b24d6552667cb',
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
'name' => 'wp-graphql/wp-graphql-acf',
),
'versions' =>
array (
'wp-graphql/wp-graphql-acf' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '1bad7d6d5214448f8d27bbcd908b24d6552667cb',
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
),
),
);
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '1bad7d6d5214448f8d27bbcd908b24d6552667cb',
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
'name' => 'wp-graphql/wp-graphql-acf',
),
'versions' =>
array (
'wp-graphql/wp-graphql-acf' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '1bad7d6d5214448f8d27bbcd908b24d6552667cb',
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
),
),
);
4 changes: 2 additions & 2 deletions wp-graphql-acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://www.wpgraphql.com
* Text Domain: wp-graphql-acf
* Domain Path: /languages
* Version: 0.5.0
* Version: 0.5.2
* Requires PHP: 7.0
* GitHub Plugin URI: https://github.com/wp-graphql/wp-graphql-acf
*
Expand All @@ -26,7 +26,7 @@
* Define constants
*/
const WPGRAPHQL_REQUIRED_MIN_VERSION = '0.4.0';
const WPGRAPHQL_ACF_VERSION = '0.5.0';
const WPGRAPHQL_ACF_VERSION = '0.5.2';

/**
* Initialize the plugin
Expand Down

0 comments on commit 87fb6ec

Please sign in to comment.