diff --git a/.github/workflows/testing-integration.yml b/.github/workflows/testing-integration.yml index 5e0f038..eb3d345 100644 --- a/.github/workflows/testing-integration.yml +++ b/.github/workflows/testing-integration.yml @@ -33,12 +33,8 @@ jobs: acf_pro: true wpgraphql_content_blocks: true coverage: 1 - - php: '8.1' - wordpress: '5.9' - php: '7.4' wordpress: '6.1' - - php: '7.3' - wordpress: '5.9' fail-fast: false name: WordPress ${{ matrix.wordpress }}, PHP ${{ matrix.php }}, ACF ${{matrix.acf_version}}, ACF & ACF EXTENDED PRO ${{matrix.acf_pro}}, WPGRAPHQL Content Blocks ${{matrix.wpgraphql_content_blocks}} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f00443..f3c30c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,34 @@ # Changelog +## 2.4.0 + +### New Features + +- [#211](https://github.com/wp-graphql/wpgraphql-acf/pull/211): feat: add wp-graphql as required plugin dependency. Thanks @stefanmomm! + +### Chores / Bugfixes + +- [#224](https://github.com/wp-graphql/wpgraphql-acf/pull/224): chore: update issue templates config.yml to link to Discord instead of Slack +- [#223](https://github.com/wp-graphql/wpgraphql-acf/pull/223): chore: update branding assets +- [#214](https://github.com/wp-graphql/wpgraphql-acf/pull/214): chore: bump composer/composer from 2.7.4 to 2.7.7 in the composer group across 1 directory + ## 2.3.0 ## Update Notice This release refactored some internals regarding how Clone fields and Group fields behave. There was no intentional breaking changes to the Schema, but if you are using Clone and Group fields there is a chance that if you were benefiting from a "bug as a feature" there might be some changes that could impact your Schema and/or resolvers, we recommend testing this update on a staging site to ensure things are still working for you as expected. Should you run into any problems, please [open a new issue](https://github.com/wp-graphql/wpgraphql-acf/issues/new/choose) and provide as much detail as possible to help us reproduce the scenario. Thanks! 🙏 -## New Features +### New Features - [#193](https://github.com/wp-graphql/wpgraphql-acf/pull/193): feat: improved handling of clone and group fields -## Chores / Bugfixes +### Chores / Bugfixes - [#194](https://github.com/wp-graphql/wpgraphql-acf/pull/194): ci: test against WordPress 6.5 ## 2.2.0 -## New Features +### New Features - [#181](https://github.com/wp-graphql/wpgraphql-acf/pull/181): feat: update docs Date fields to link to the RFC3339 spec diff --git a/readme.txt b/readme.txt index c9c6a99..5893251 100644 --- a/readme.txt +++ b/readme.txt @@ -120,12 +120,28 @@ This release is a complete re-architecture of WPGraphQL for ACF, introducing bre == Changelog == += 2.4.0 = + +**New Features** + +- [#211](https://github.com/wp-graphql/wpgraphql-acf/pull/211): feat: add wp-graphql as required plugin dependency. Thanks @stefanmomm! + +**Chores / Bugfixes** + +- [#224](https://github.com/wp-graphql/wpgraphql-acf/pull/224): chore: update issue templates config.yml to link to Discord instead of Slack +- [#223](https://github.com/wp-graphql/wpgraphql-acf/pull/223): chore: update branding assets +- [#214](https://github.com/wp-graphql/wpgraphql-acf/pull/214): chore: bump composer/composer from 2.7.4 to 2.7.7 in the composer group across 1 directory + = 2.3.0 = **New Features** +- [#193](https://github.com/wp-graphql/wpgraphql-acf/pull/193): feat: improved handling of clone and group fields + **Chores / Bugfixes** +- [#194](https://github.com/wp-graphql/wpgraphql-acf/pull/194): ci: test against WordPress 6.5 + = 2.2.0 = **New Features** diff --git a/src/AcfGraphQLFieldType.php b/src/AcfGraphQLFieldType.php index 3881971..887c6fc 100644 --- a/src/AcfGraphQLFieldType.php +++ b/src/AcfGraphQLFieldType.php @@ -166,9 +166,11 @@ public function get_admin_field_settings( array $field, Settings $settings ) { // Get the admin fields for the field type $admin_fields = $this->get_admin_fields( $field, $default_admin_settings, $settings ); + $excluded_admin_fields = $this->get_config( 'exclude_admin_fields' ); + // Remove excluded fields - if ( isset( $this->config['exclude_admin_fields'] ) && is_array( $this->config['exclude_admin_fields'] ) ) { - foreach ( $this->config['exclude_admin_fields'] as $excluded ) { + if ( is_array( $excluded_admin_fields ) ) { + foreach ( $excluded_admin_fields as $excluded ) { unset( $admin_fields[ $excluded ] ); } } diff --git a/src/FieldConfig.php b/src/FieldConfig.php index 67bf30a..624e85a 100644 --- a/src/FieldConfig.php +++ b/src/FieldConfig.php @@ -436,7 +436,6 @@ public function resolve_field( $root, array $args, AppContext $context, ResolveI return $pre_value; } - $parent_field = null; $parent_field_name = null; if ( ! empty( $field_config['parent'] ) ) { $parent_field = acf_get_field( $field_config['parent'] ); @@ -445,12 +444,19 @@ public function resolve_field( $root, array $args, AppContext $context, ResolveI } } - // resolve block field - if ( is_array( $node ) && isset( $node['blockName'] ) && isset( $node['attrs'] ) ) { - $block = acf_prepare_block( $node['attrs'] ); + if ( is_array( $node ) && isset( $node['blockName'], $node['attrs'] ) ) { + $block = $node['attrs']; + + // Ensure the block has an ID + if ( ! isset( $block['id'] ) ) { + $block['id'] = uniqid( 'block_', true ); + } + + $block = acf_prepare_block( $block ); $block_id = acf_get_block_id( $node['attrs'] ); $block_id = acf_ensure_block_id_prefix( $block_id ); + acf_setup_meta( $block['data'], $block_id, true ); $return_value = $this->get_field( $field_config['name'], $parent_field_name, $block_id, $should_format_value ); diff --git a/tests/_support/WPUnit/AcfFieldTestCase.php b/tests/_support/WPUnit/AcfFieldTestCase.php index 7a8f601..8da9b3c 100644 --- a/tests/_support/WPUnit/AcfFieldTestCase.php +++ b/tests/_support/WPUnit/AcfFieldTestCase.php @@ -414,10 +414,10 @@ interfaces { ], ]); - codecept_debug([ - '$content' => $content, - '$parsed_blocks' => parse_blocks( $content ), - ]); +// codecept_debug([ +// '$content' => $content, +// '$parsed_blocks' => parse_blocks( $content ), +// ]); // assert the data is returned as expected self::assertQuerySuccessful( $actual, [ diff --git a/wpgraphql-acf.php b/wpgraphql-acf.php index f2cabc3..c3739cb 100644 --- a/wpgraphql-acf.php +++ b/wpgraphql-acf.php @@ -4,7 +4,7 @@ * Description: WPGraphQL for ACF seamlessly integrates Advanced Custom Fields with WPGraphQL. * Author: WPGraphQL, Jason Bahl * Author URI: https://www.wpgraphql.com - * Version: 2.3.0 + * Version: 2.4.0 * Text Domain: wpgraphql-acf * Requires PHP: 7.3 * Requires at least: 5.9 @@ -32,7 +32,7 @@ } if ( ! defined( 'WPGRAPHQL_FOR_ACF_VERSION' ) ) { - define( 'WPGRAPHQL_FOR_ACF_VERSION', '2.3.0' ); + define( 'WPGRAPHQL_FOR_ACF_VERSION', '2.4.0' ); } if ( ! defined( 'WPGRAPHQL_FOR_ACF_VERSION_WPGRAPHQL_REQUIRED_MIN_VERSION' ) ) {