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

Navigation Blocks not working with GeneratePress theme #28644

Closed
imintenn opened this issue Feb 1, 2021 · 22 comments
Closed

Navigation Blocks not working with GeneratePress theme #28644

imintenn opened this issue Feb 1, 2021 · 22 comments
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended

Comments

@imintenn
Copy link

imintenn commented Feb 1, 2021

Description

Horizontal navigation block was inserted into a page using Gutenberg editor. This is using GeneratePress theme. After the navigation block is inserted, nothing happens except a spinning wheel is in the field, and this never stops.

Step-by-step reproduction instructions

  1. Edit page
  2. Add block
  3. Select "Navigation (horizontal)"
  4. That's as far as it goes. Navigation never populates - only the spinning wheel can be seen. Can't update or preview page.

Expected behaviour

Actual behaviour

Screenshots or screen recording (optional)

Code snippet (optional)

WordPress information

  • WordPress version:
  • Gutenberg version:
  • Are all plugins except Gutenberg deactivated?
  • Are you using a default theme (e.g. Twenty Twenty-One)?

Device information

  • Device:
  • Operating system:
  • Browser:
@talldan
Copy link
Contributor

talldan commented Feb 2, 2021

@imintenn I couldn't reproduce an issue:
Feb-02-2021 08-53-51

Perhaps you have some other plugins active that might be causing an issue. When an empty navigation block is first added it makes an HTTP request to fetch details of pages on the site, so it might be a plugin blocking that request. If you're comfortable using the browser dev tools, the network tab could have some revealing details.

One thing that could be improved is that the block could better handle errors in HTTP requests, ideally showing a visible error notification, but still allowing users to add pages.

@talldan talldan added [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended labels Feb 2, 2021
@imintenn
Copy link
Author

imintenn commented Feb 2, 2021 via email

@talldan
Copy link
Contributor

talldan commented Feb 2, 2021

@imintenn Let us know how the testing goes, hopefully we'll manage to work out what the problem is.

@jasmussen jasmussen added the [Status] Needs More Info Follow-up required in order to be actionable. label Feb 26, 2021
@SenorThree
Copy link

I'm experiencing the exact same thing with GeneratePress theme. I googled gutenberg navigation block "spinning" and I found this page. I can't think of anything that I'm running that would affect http requests, but this at least gives me somewhere to start.

Thanks!

@SenorThree
Copy link

Hmm. this is the error that's showing when I inspect the page.

GET https://website.com/wp-json/wp/v2/pages?parent=0&order=asc&orderby=id&per_page=100&context=edit&_locale=user 500
index.js?ver=46a7b96014667a4db8446b25a6b89781:1 Uncaught (in promise) Response {type: "basic", url: "https://website.com/wp-json/wp/v2/pages?paren…orderby=id&per_page=100&context=edit&_locale=user", redirected: false, status: 500, ok: false, …}

If I follow the URL, I'm seeing this error:

{"code":"rest_forbidden_context","message":"Sorry, you are not allowed to edit posts in this post type.","data":{"status":401}}

I have absolutely no idea of what I'm looking at, but it makes me think that GeneratePress Elements editor doesn't have the access to see the list of menus.

Makes me think that we need to bring this up with GeneratePress, rather than Gutenberg. Unless somebody here has an epiphany!

@SenorThree
Copy link

This is interesting. I'd say imintenn and I are not experiencing the same problem. I can create a navigation menu block in a page with no problem. I cannot create a navigation menu block in a Generate Press Element Block (Appearance / Elements / New Block).

I'm opening a ticket on GeneratePress support since I'm now convinced that my situation is some kind of permission problem.

@imintenn
Copy link
Author

imintenn commented Mar 11, 2021 via email

@talldan
Copy link
Contributor

talldan commented Mar 11, 2021

Are you admin level users, or some other level?

@imintenn
Copy link
Author

imintenn commented Mar 11, 2021 via email

@talldan
Copy link
Contributor

talldan commented Mar 11, 2021

How about you, @SenorThree?

@SenorThree
Copy link

Yes, admin.

@SenorThree
Copy link

I've opened a ticket with GeneratePress, so if anybody stumbles across this ticket and is experiencing what I'm experiencing, they may find more information here:
https://generatepress.com/forums/topic/navigation-blocks-not-working-with-generatepress-elements-blocks/#new-post

In the GeneratePress forum, I've linked back to this ticket, so hopefully if imintenn and/or I get answers, we can help future sufferers of this issue.

@talldan
Copy link
Contributor

talldan commented Mar 11, 2021

Seems unusual from what I can tell. The error is basically saying that you don't have permissions to edit pages. If there are other plugins you have active for controlling access rights, then that could be related.

The block code should handle this better so that the block can still be used (it might be a legitimate permissions problem for some users). So I still think this issue could be kept open as a bug.

@SenorThree
Copy link

SenorThree commented Mar 11, 2021

Since I'm editing a GeneratePress Elements Block, I could see how "asking get permission to edit pages" might get forgotten, since I'm "just" creating a block that the theme will pull in when it renders the (in this case) footer, and not actually editing a page.

I can't think of any plugin that I would be running that would be controlling access rights.

@imintenn, were you able to use the inspector to see what was failing for you?

@SenorThree
Copy link

Okay, now it's getting weird. I wanted to recreate what @imintenn was doing, in case it was the Container or Grid that was causing the problem. Now I can't create a navigation block in a page either.

At one point, it seemed like one of the navigation menu blocks that I had attempted to create had timed out and showed 3 gray boxes where the menu options should go. I did some voodoo ritual with loading / saving / not saving / refreshing / something, and it let me select the menu on that page that it moments earlier would not go past the spinning wheel. I tried recreating that voodoo ritual to no avail.

On the off chance that there was some kind of artifact issue from creating a functioning navigation block on my first test page, I tried adding a navigation block to a completely different page, and all I get is the spinning block.

So maybe my issue is the same as what @imintenn is experiencing.

@SenorThree
Copy link

Now it's getting weirder. I was going to start experimenting with disabling caching, but before I changed anything, I wanted to clean up all of the pages and Element Blocks I was experimenting on.

All of a sudden, I can create any navigation menu block that I want to. I've added 3 of them to my Elements Footer Block.
I was able to add a navigation menu block in a page. I was able to add a navigation menu block in a container in a page. I was able to add a navigation menu block in a container in a grid in a page.

I can confirm that nobody from GeneratePress forum has made any changes (They got caught by my CloudFlare firewall rules) I can't explain why it seems that everything is working now.

@imintenn, maybe you want to try again...

@imintenn
Copy link
Author

Since I'm editing a GeneratePress Elements Block, I could see how "asking get permission to edit pages" might get forgotten, since I'm "just" creating a block that the theme will pull in when it renders the (in this case) footer, and not actually editing a page.

I can't think of any plugin that I would be running that would be controlling access rights.

@imintenn, were you able to use the inspector to see what was failing for you?

@SenorThree I did try to use the inspector, but did not really understand it. I did not go through the process of deactivating plugins, and decided to use the standard header provided by GeneratePress.

@imintenn
Copy link
Author

Now it's getting weirder. I was going to start experimenting with disabling caching, but before I changed anything, I wanted to clean up all of the pages and Element Blocks I was experimenting on.

All of a sudden, I can create any navigation menu block that I want to. I've added 3 of them to my Elements Footer Block.
I was able to add a navigation menu block in a page. I was able to add a navigation menu block in a container in a page. I was able to add a navigation menu block in a container in a grid in a page.

I can confirm that nobody from GeneratePress forum has made any changes (They got caught by my CloudFlare firewall rules) I can't explain why it seems that everything is working now.

@imintenn, maybe you want to try again...

@SenorThree I tried to enter the horizontal menu in the column block again, and same result for me. Spinning disk that never stops. I can't publish the page. I have found the only way to stop is to delete the navigation block or leave the page without saving.

This is how the block looks - white box, the gray disc at the left spins.
image

@github-actions
Copy link

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Mar 27, 2021
@imintenn
Copy link
Author

I do not have time to test this problem. I have decided to deactivate the Gutenberg plugin since the navigation block does not work in my application. Hopefully this resolves in a later version.
Thank you for the support.

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Mar 28, 2021
@talldan talldan removed the [Status] Needs More Info Follow-up required in order to be actionable. label Mar 29, 2021
@jasmussen
Copy link
Contributor

From looking at the ticket linked, a Cloudflare firewall issue was suggested as a potential issue. In any case for now I'm going to close this one, but if new information arises or if anyone is able to confirm or provide reproducible steps, don't hesitate to comment and we'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants
@talldan @jasmussen @SenorThree @imintenn and others