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

ACF_Link is being registered multiple times #189

Closed
SmartyP opened this issue Dec 3, 2020 · 14 comments
Closed

ACF_Link is being registered multiple times #189

SmartyP opened this issue Dec 3, 2020 · 14 comments

Comments

@SmartyP
Copy link

SmartyP commented Dec 3, 2020

In trying to track down why my Gatsby previews are failing, and in the process I noticed a warning stating:

"type": "DUPLICATE_TYPE",
"message": "You cannot register duplicate Types to the Schema. The Type 'ACF_Link' already exists in the Schema. Make sure to give new Types a unique name.",
"type_name": "ACF_Link",

I found where this message is printed out in wp-graphql-1.0/src/Registry/TypeRegistry.php and put an error_log statement in place. My error log got flooded out with this same error about ACF_Link being registered multiple times.

In looking at wp-graphql-acf-release-v0.3.5/src/class-config.php in the method register_graphql_field, for the case link, it appears to always register the $field_type_name of ACF_Link, whereas other cases in here seem to append other variances to the end of the field name before registering them. When putting error_log() statements in this case I find dozens/hundreds of times ACF_Link gets used for the $field_type_name (even though they each have differing $type_name values).

I'm not sure if this is related to my preview not working, but I wanted to file a ticket as it seems this warning is firing hundreds of times under the covers either way and potentially should be revisited..?

@ohuu
Copy link

ohuu commented Dec 8, 2020

I have exactly the same problem. Thought I'd just put a +1 on this issue

@nhankla-kl
Copy link

Same issue:
Plugins Used: Wpgraphql 1.0.1
WPGraphql ACF 0.3.4

"type": "DUPLICATE_TYPE", "message": "You cannot register duplicate Types to the Schema. The Type 'ACF_Link' already exists in the Schema. Make sure to give new Types a unique name.", "type_name": "ACF_Link",

@lqze
Copy link

lqze commented Dec 10, 2020

This is a known bug apparently.

@PieterT2000
Copy link

In my case it occurs because a ACF Group is being displayed on multiple pages using conditions.
image

If I display the group only on one page, the error will disappear.

@elijameslennox
Copy link

elijameslennox commented Jan 4, 2021

Is there any movement on this? My site does re-use ACF field groups across multiple templates and custom post types and this bug makes this plugin useless. I otherwise love WPGraphQL and really would like to use it on this and other projects.

@danielnedelcu90
Copy link

First off, many thanks to the creator of this amazing plugin!
I too am stuck with this issue and would really appreciate a fix 👍

@ChristopherNowlan
Copy link

Are we close to resolving this issue?

@ssoney200
Copy link

Same issue here

@AlexAlmeidaNS
Copy link

Same here

@merapi
Copy link

merapi commented Feb 4, 2021

We also have the same problem, we cannot update the plugin because the site stops working.

@kidunot89 Does it look like a small or big fix for you?

@K-JAX
Copy link

K-JAX commented Feb 8, 2021

Same issue here.

@nyvek28
Copy link

nyvek28 commented Feb 19, 2021

Same issue here :(

@guayom
Copy link

guayom commented Feb 19, 2021

Same issue!

@jasonbahl
Copy link
Contributor

Hello,

Apologies for the delay in responding.

The debug message should not be affecting execution. This bug has actually existed for a long time, but a change to WPGraphQL core leading up to the v1.0 release surfaced it in a debug message, where before it would silently happen, just without letting us know.

I explain a bit more about this here: #198 (comment)

I'm going to close this issue as a duplicate of #198

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

No branches or pull requests