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

Unable to Make Menus and Menu Items public #3080

Open
3 tasks done
hmingv opened this issue Mar 27, 2024 · 6 comments
Open
3 tasks done

Unable to Make Menus and Menu Items public #3080

hmingv opened this issue Mar 27, 2024 · 6 comments
Labels
Component: Query Needs: Info More information is needed to resolve this issue Needs: Reproduction This issue needs to be reproduced independently. ObjectType: Menu Regression Bug that caused a regression to a previously working feature Status: Awaiting Author Response Additional information has been requested from the author Type: Bug Something isn't working

Comments

@hmingv
Copy link

hmingv commented Mar 27, 2024

Description

We have no problem using the code below when using WP-Graphql V1.12.2.

Make Menus and Menu Items public

When I updated to V 1.22.1 it had no effect.

Steps to reproduce

  1. Install a clean WordPress installation
  2. Install WPGraphQL V1.12.2 version
  3. Add the code in the document to the theme or plug-in
  4. Test (everything is fine at this point)
  5. Update WPGraphQL to the latest version
  6. Test (failed)

Additional context

No response

WPGraphQL Version

1.22.1

WordPress Version

6.4

PHP Version

8.1

Additional environment 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.

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

hmingv commented Mar 27, 2024

After testing, I traced that the problem started appearing in version V1.22.0.

@hmingv
Copy link
Author

hmingv commented Mar 27, 2024

Depending on the theme we are using, the menu will not have its location set.

Does this have anything to do with it?

However, logged in users can view all menus, but they cannot be read publicly.

@justlevine
Copy link
Collaborator

Thanks for reporting this @hmingv !

If you're tracing the change in behavior to v1.22.0, it's likely coming from #3043 . Whether this is a regression, intended behavior that requires updating that recipe, or the result of relying #3029 as a feature in your local query s another story.

In order for us to replicate and debug, can you please provide:

  1. The GraphQL query you are fetching (bonus points if you can also screenshot it with the results in the GraphiQL IDE)
  2. Your menu config (including the menu location it's assigned to, or whether it is unassigned).

Thanks!

@justlevine justlevine added Type: Bug Something isn't working Needs: Info More information is needed to resolve this issue Needs: Reproduction This issue needs to be reproduced independently. Status: Awaiting Author Response Additional information has been requested from the author Component: Query ObjectType: Menu Regression Bug that caused a regression to a previously working feature labels Mar 27, 2024
@hmingv
Copy link
Author

hmingv commented Mar 27, 2024

Examples of unexpected results are as follows:

image

image

Use unauthorized account:

image

Use logged in account:

image

@hmingv
Copy link
Author

hmingv commented Mar 27, 2024

Now I downgrade the plugin:

image

Using an unauthorized account now gives the expected results:

image

@hmingv
Copy link
Author

hmingv commented Mar 27, 2024

GraphQL query:

query MenuItems {
  menuItems(first: 200, where: {parentDatabaseId: 0}) {
    nodes {
      id
      label
      uri
      childItems {
        nodes {
          id
          target
          childItems {
            nodes {
              id
              label
              target
              uri
              description
              cssClasses
              childItems {
                nodes {
                  id
                  label
                  uri
                  target
                  cssClasses
                }
              }
            }
          }
        }
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Needs: Info More information is needed to resolve this issue Needs: Reproduction This issue needs to be reproduced independently. ObjectType: Menu Regression Bug that caused a regression to a previously working feature Status: Awaiting Author Response Additional information has been requested from the author Type: Bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants