Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with ACF v6.0 and higher #38

Open
codysign opened this issue Oct 6, 2022 · 9 comments
Open

Not working with ACF v6.0 and higher #38

codysign opened this issue Oct 6, 2022 · 9 comments

Comments

@codysign
Copy link

codysign commented Oct 6, 2022

If you are using ACF version 6.0 and higher, all returned field values will be null or empty.
After downgrading ACF to v5.9 the values are available again.

@CesarBenavides777
Copy link

CesarBenavides777 commented Oct 19, 2022

@pristas-peter
@codysign also getting this on latest versions of everything:

query NewQuery {
  page(id: "/", idType: URI) {
    blocksJSON
    blocks {
      ... on AcfHeroBlock {
        heroFields {
          title
          content
          backgroundImage {
            id
          }
        }
        attributesJSON
      }
    }
  }
}

image

@CesarBenavides777
Copy link

Might be related to this function:

protected function add_acf_fields_to_block( $block_type ) {
			$field_groups = acf_get_field_groups(
					array(
							'block' => $block_type['name'],
					)
			);

			if ( empty( $field_groups ) || ! is_array( $field_groups ) ) {
				return;
			}

			$type_name = BlockTypes::format_block_name( $block_type['name'] );

			foreach ( $field_groups as $field_group ) {
				$field_name = isset( $field_group['graphql_field_name'] )
						? $field_group['graphql_field_name']
						: Config::camel_case( $field_group['title'] );

				$field_group['type'] = 'group';
				$field_group['name'] = $field_name;
				$config              = array(
						'name'            => $field_name,
						'description'     => $field_group['description'],
						'acf_field'       => $field_group,
						'acf_field_group' => null,
						'resolve'         => function ( $root ) use ( $field_group ) {
							return isset( $root ) ? $root : null;
						},
				);

				$this->register_graphql_field( $type_name, $field_name, $config );
			}
		}

/wp-graphql-gutenberg-acf-develop/plugin.php

@cgatherer
Copy link

cgatherer commented Oct 21, 2022

@codysign @CesarBenavides777 I'm having a similar issue, by chance did you figure out a solution for the latest versions of ACF?

@codysign
Copy link
Author

@cgatherer #39

@andresantiagohellmann
Copy link

Has anyone managed to resolve?

@natedin
Copy link

natedin commented Jun 23, 2023

Still having this problem, is there a fix? Seems like this plugin is no longer being maintained

@4rt10m
Copy link

4rt10m commented Jul 15, 2023

Has anyone found a solution to this? Is there an alternative / similar plugin?

@ttstauss
Copy link

Bummer, we have to abandon this plugin due it preventing us from updating ACF to version 6.0 which is now a requirement. If anyone has alternative solutions I'd love to hear them.

@natedin
Copy link

natedin commented Nov 14, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants