Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Recent regressions with WPML, ACF, and GraphQL #355

Closed
SmartyP opened this issue Apr 28, 2023 · 2 comments
Closed

Recent regressions with WPML, ACF, and GraphQL #355

SmartyP opened this issue Apr 28, 2023 · 2 comments
Labels
close candidate status: awaiting author response Additional information has been requested from the author

Comments

@SmartyP
Copy link

SmartyP commented Apr 28, 2023

We have a site that uses ACF, with WPML, exposed via GraphQL, and we're noticing a number of recent regressions. They seem to have started around November/December 2022 - roughly around the release of WordPress 6.1.

What we've found is if we bring our site up to date (WordPress core, ACF, WPML, etc. etc.) then several things break in our GraphQL queries. The first is that querying for menu data for non-default languages no longer works - this was reported on the wp-graphql-wpml Github issues here (ref).

Another issue we are seeing is that some of our fields go missing in GraphQL after we update to the latest release of Advanced Custom Fields Multilingual.

For example, this query:

query Testing {
  page(id: "xxxzdDoxMDI4OA==") {
    contentBlocksModules {
      modules {
        ... on ContentNode_Contentblocksmodules_Modules_LeftRight {
          additionalClasses
          anchor
          preheadText
          preheadType
          titleText
          titleType
          actions {
            adaText
            function
            seoText
          }
        }
      }
    }
  }
}

Works up until we update Advanced Custom Fields Multilingual. After that update, this query will fail saying that preheadText, preheadType, titleText, titleType, and actions fields don't exist. We can still see these fields existing when editing the content, and we can still see these fields existing when querying for the same page in the REST API, but the fields no longer show in the GraphQL Query Composer and our queries fail with errors.

After the updates, when using the Query Composer, we can see new fields that exist that have similar names, but all prefixed with defaultHeroPreheadDefaultHero - you can see a modified query here which uses these new fields showing in GraphQL, but they all return null (not the data):

query Testing {
  page(id: "xxxzdDoxMDI4OA==") {
    contentBlocksModules {
      modules {
        ... on ContentNode_Contentblocksmodules_Modules_LeftRight {
          additionalClasses
          anchor
          defaultHeroPreheadDefaultHeroPreheadText
          defaultHeroPreheadDefaultHeroPreheadType
          defaultHeroTitleDefaultHeroTitleText
          defaultHeroTitleDefaultHeroTitleType
          defaultHeroActions {
            adaText
            function
            seoText
          }
        }
      }
    }
  }
}

Only this (^) query fails along with this query:

query getsettings {
  themeGeneralSettings {
    settingsAlerts {
      globalAlertDisplay
      fieldGroupName
      alertGroup {
        globalAlertContentActions {
          link {
            target
            title
            url
          }
        }
      }
    }
  }
}

Which has globalAlertContentActions become a missing field, and a new field globalAlertContentAlertContentAlertContentAlertContentAlertContentAlertContentActions appear instead.

query getsettings {
  themeGeneralSettings {
    settingsAlerts {
      globalAlertDisplay
      fieldGroupName
      alertGroup {
        globalAlertContentAlertContentAlertContentAlertContentAlertContentAlertContentActions {
          link {
            target
            title
            url
          }
        }
      }
    }
  }
}

We understand that the updating of Advanced Custom Fields Multilingual is what breaks these queries, but since the data still exists in the page editor using ACF, and since the data still returns via REST API, it seems specific to GraphQL that the data no longer returns after that plugins update, and GraphQL Query Composer no longer lists these fields as existing. Since we had also seen the multilingual menu issue with GraphQL (noted above), it seemed to make the most sense to file this ticket here as our assumption is that this plugin (or WPGraphQL core) will need updates in order to properly return these ACF fields again.

@jasonbahl
Copy link
Contributor

@SmartyP I'm not familiar with wp-graphql-wpml or ACF Multilingual enough to offer support for those plugins.

If you're able to provide concrete steps to reproduce that show that there's a bug in this plugin, we can look into addressing it, but I'd need a lot more information to determine if it's a bug with this plugin vs. a config issue with your field groups, or a bug in another plugin.

If you're able to reproduce the issue consistently and can provide clear steps to reproduce, (and even better, provide plugin version numbers where things worked as expected) then we might be able to help more.

@jasonbahl jasonbahl added status: awaiting author response Additional information has been requested from the author close candidate labels Oct 30, 2023
@jasonbahl
Copy link
Contributor

We're re-building WPGraphQL for ACF over here: https://github.com/wp-graphql/wpgraphql-acf and that version will be released on WordPress.org and is the version we will be supporting long-term.

I recommend migrating at your earliest convenience. It is a complete re-architecture, and the schema will have some changes so there will likely need to be some refactoring of any GraphQL Queries / Fragments.

If you have the chance to migrate and are still facing issues with compatibility with WPML + ACF + WPGraphQL, please open a new issue on the new repo with clear steps to reproduce.

Thanks 🙏🏻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
close candidate status: awaiting author response Additional information has been requested from the author
Projects
None yet
Development

No branches or pull requests

2 participants