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

Clone Fields seem to be broken with latest release #237

Open
2 of 3 tasks
infn8 opened this issue Aug 21, 2024 · 7 comments
Open
2 of 3 tasks

Clone Fields seem to be broken with latest release #237

infn8 opened this issue Aug 21, 2024 · 7 comments
Labels
needs: reproduction This issue needs to be reproduced independently

Comments

@infn8
Copy link

infn8 commented Aug 21, 2024

Description

I am using a clone field and it has been working, but updating to the latest version of the plug-in breaks it

Steps to reproduce

  • Create a field with ACF
  • Clone that field into another section of your field groups somewhere
  • graphQL Query the field groups on both the original and the clone.
  • Notice that the graphQL schema errors on the clone

PHP or JSON export of the ACF Field Group(s)

No response

Additional context

No response

WPGraphQL Version

Version 1.28.0

WPGraphQL For ACF Version

2.4.1

ACF (Advanced Custom Fields) Version. Free or Pro?

pro Version 6.3.5

WordPress Version

6.6.1

PHP Version

PHP 8.2

Additional enviornment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL, WPGraphQL For ACF, ACF, etc.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@josephfusco
Copy link
Member

Hey @infn8, can you please provide an export of your site's ACF field groups? This will allow us to better understand your setup.

Which version of WPGraphQL for ACF was last working for you prior to updating to the latest (currently 2.4.1)?

@josephfusco josephfusco added the needs: author response Pending information from the author label Aug 21, 2024
@infn8
Copy link
Author

infn8 commented Aug 21, 2024

2.2.0 was the last working version. I have also uploaded a walk through video here:

https://infn8.notion.site/Bug-Report-for-WPGraphQL-for-ACF-Version-2-4-1-39617cd8674a43868bd3293b568861c1

here is a zip of my ACF JSON folder in my theme.

the field in question is field_6666fb73f66d0 in group_6666fb7162288.json which clones field_6666fbc6f66d1 in group_6666fb7162288.json

the graphQL that DID work in version 2.2.0 is:

query GetPage($databaseId: ID!, $asPreview: Boolean = false) {
  page(id: $databaseId, idType: DATABASE_ID, asPreview: $asPreview) {
    title
    content
    whereToBuyDetails {
      featureTileDetails {
        title
        subtitle
        pretitle
        miceType
        backgroundColor
        image {
          node {
            sourceUrl
            srcSet
            uri
          }
        }
      }
    }
  }
  locations(first: 999, where: {hideEmpty: false}) {
    nodes {
      uri
      slug
      name
    }
  }
  retailers(first: 999) {
    nodes {
      id
      title
      terms {
        nodes {
          ... on Location {
            name
            slug
          }
        }
      }
      retailerDetails {
        retailUrl
        retailerLogo {
          node {
            mediaItemUrl
            srcSet
          }
        }
      }
    }
  }
}

acf-json.zip

@infn8
Copy link
Author

infn8 commented Aug 21, 2024

the error was

{
  "errors": [
    {
      "message": "Cannot query field \"featureTileDetails\" on type \"WhereToBuyDetails\".",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 6,
          "column": 7
        }
      ]
    }
  ],
  "extensions": {
    "debug": [],
    "queryAnalyzer": {
      "keys": "5305d35ebb090a5f4174edefcf4cd72c2570c5da3215a0a64b8e2dab16e3d7b5 graphql:Query operation:GetPage list:location list:retailer",
      "keysLength": 124,
      "keysCount": 5,
      "skippedKeys": "",
      "skippedKeysSize": 0,
      "skippedKeysCount": 0,
      "skippedTypes": []
    }
  }
}

@josephfusco josephfusco added needs: reproduction This issue needs to be reproduced independently and removed needs: author response Pending information from the author labels Aug 22, 2024
@elliott-w
Copy link

elliott-w commented Aug 27, 2024

@infn8 this is probably the same issue as #233. Can you try the following:

In your Where to Buy Details field group (group_6666fc462d63a), wrap the Feature Tile Details clone field (field_6666fc47a48e3) in a group field. Also ensure that your clone field display is set to Seamless

@marco910
Copy link

I'm experiencing a similar issue where I have a clone field which contains a repeater field with a single text field.

Normally the query would look like
Bildschirmfoto 2024-09-15 um 13 31 15

But with the latest release it forces me to a query like this
Bildschirmfoto 2024-09-15 um 13 28 43

This results in this error
Bildschirmfoto 2024-09-15 um 13 28 38

@marco910
Copy link

@elliott-w I tried your approach, but it didn't work for me.

I also noticed that the fields of the clone field are completely messed up, and fields from a completely different group are listed in the schema.

Is there any information when we can expect a fix of this? Our site really relies on that feature, and we need to update to the latest version of that plugin to keep our site working.

@marco910
Copy link

Hi everyone,

Since we had some trouble with missing or broken clone fields on our site, I tested around and found a possible cause/solution for the issue. Maybe this also works for you @infn8

In our scenario we had multiple blocks like buttons, sliders etc. defined a separate fieldgroups and added them to other fieldgroups as clone fields (which worked pretty well so far). One single group was causing issues in GraphQL.

After a deeper look, I noticed that the GraphQL name of the fieldgroup (in the GraphQL settings tab in the fieldgroup settings) had the same name as another fieldgroup.
I changed the GraphQL name to something different and unique and everything worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: reproduction This issue needs to be reproduced independently
Projects
None yet
Development

No branches or pull requests

4 participants