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

Nav Screen: No way to create a menu when a user has no menus #32256

Closed
talldan opened this issue May 27, 2021 · 5 comments · Fixed by #32313
Closed

Nav Screen: No way to create a menu when a user has no menus #32256

talldan opened this issue May 27, 2021 · 5 comments · Fixed by #32313
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@talldan
Copy link
Contributor

talldan commented May 27, 2021

Description

At the moment the navigation screen seems to shown an incorrect state when a user has no menus, and the user has no way to create a first menu.

Screenshot 2021-05-27 at 10 30 19 am

The culprit seems to be a failed REST request for fetching menus. Possibly this hasn't been caught by end to end tests because those use endpoint mocking. I'm not sure why this is suddenly an issue, perhaps a change in the REST endpoints?

Here's the failed request:
Screenshot 2021-05-27 at 10 34 01 am
Screenshot 2021-05-27 at 10 42 12 am

Step-by-step reproduction instructions

  1. Delete all menus, or start with a completely fresh WordPress installation
  2. Enable the navigation screen experiment.
  3. Browse to the navigation screen.

Expected behaviour

The UI for creating a first menu is displayed.

And also, if a REST Request is failed, it's handled and an error state is shown.

Actual behaviour

The screen shows some of the UI from when a menu exists.

@talldan talldan added [Type] Regression Related to a regression in the latest release [Feature] Navigation Screen labels May 27, 2021
@talldan
Copy link
Contributor Author

talldan commented May 27, 2021

Actually, I think there are some other issues beyond when the user has no menus. After creating a menu in the old screen it's showing up as empty an un-named:
Screenshot 2021-05-27 at 10 52 45 am

But it definitely has one link and is titled 'Main Menu':
Screenshot 2021-05-27 at 10 54 49 am

@getdave
Copy link
Contributor

getdave commented May 27, 2021

@Mamaduka Anything to do with our recent refactoring in and around this area?

@Mamaduka
Copy link
Member

@getdave Can be related, but I think I fixed all regressions I could find.

@talldan I'm not able to fully reproduce the issue with the current trunk. I can see 404 in the console, but the correct state when there are no menus.

@getdave
Copy link
Contributor

getdave commented May 28, 2021

I re-tested this and I can see the request going out to

http://localhost:8888/wp-json/__experimental/menus/

That returns the expected empty array [].

However the app still thinks we have a selected menu ID so it then tries to make a request for that selected menu ID which doesn't exist so we get the error Dan was seeing.

Working on a fix.

@Mamaduka
Copy link
Member

I was finally able to reproduce the broken screen.

I had to delete menus from the non-experimental Menus screen. There are multiple ways to delete menus, so the guard clause is proposed in #32306 makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
3 participants