wp-graphql / wp-graphql-acf

WPGraphQL for Advanced Custom Fields
https://wpgraphql.com/acf
627 stars 123 forks source link

ACF fields without a key attribute #358

Closed EddyRespondek closed 1 year ago

EddyRespondek commented 1 year ago

Discovered a issue using the "Advanced Custom Fields: Component Field" plugin which appears to add empty fields in the json export and causes our php log to flood with errors. Simple fix is just to skip fields without a key.

in /src/class-config.php after line 1246 can this new line be added please?

if ( !isset($acf_field['key']) ) { continue; }

jasonbahl commented 1 year ago

@EddyRespondek I'm curious if this is a bug in the new version of WPGraphQL for ACF being worked on over here: https://github.com/wp-graphql/wpgraphql-acf

If the ACF Component Field does not work with the new version, let us know in an issue over there.

If you NEED this to work for this version of WPGraphQL for ACF and cannot upgrade to the new version for whatever reason, I'd recommend adding this change to a fork and using the fork until you're able to upgrade.

The new version is what we'll be supporting going forward (will be on the .org repo soon, etc) and this repo will be archived in the not-too-distant future.