WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.47k stars 4.18k forks source link

core/navigation no longer available on the Widgets screen #36469

Open paulwilde opened 2 years ago

paulwilde commented 2 years ago

Description

Updating the plugin to 11.9.0 seems to have broken core/navigation on the Widgets screen. Previously it was an available block, but now it's no longer possible to be selected.

Step-by-step reproduction instructions

  1. Try to add a core/navigation block into the Widget screen
  2. You will not see it is unavailable to add
  3. If you had an existing block it now says Your site doesn’t include support for the "core/navigation" block. You can leave this block intact or remove it entirely.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

annezazu commented 2 years ago

Thanks for reporting this! Flagging for some devs who might be able to share some insight. I can confirm the navigation block isn't an option in the block widgets editor but I do see a Navigation Menu option that allows you to add in a menu. I wasn't able to see at a glance any PRs that might have impacted this recently but could be missing some insight!

annezazu commented 2 years ago

To follow up here, this was an intentional change to remove the navigation block from the widgets editor for the Gutenberg plugin:

https://github.com/WordPress/gutenberg/pull/35979

Since the navigation block was never ported to core, there has not been a core version in the widgets screen. When preparing for 5.9, some folks made changes to ensure that as the navigation block on it's own shouldn't be present in that screen right now. As a result, I'm going to close this out as there's not much that can be fixed here I'm afraid.

coreyworrell commented 2 years ago

@annezazu Navigation block is now in core, so shouldn't it be allowed on the widgets screen? Does not work still in 5.9.3

isuke01 commented 1 year ago

@annezazu Still an issue with 6.1.0. Block is missing from widgets.

annezazu commented 1 year ago

@scruffian mind following up on this as someone deeply involved in current navigation block work? For now, going to re-open this!

scruffian commented 1 year ago

We do have a classic menus widget. Is there a need for a navigation block widget too?

spencer-j commented 1 year ago

@scruffian a classic menu is not a navigation block, if i have core/navigation menu somewhere i also might want to include it in the widget area. As of now i can't even do it with the "allowed_block_types_all" filter see. https://github.com/WordPress/gutenberg/issues/28517#issuecomment-1070239810 this is inconsistent when navigation block isn't addable with this filter. Greets spencer

scruffian commented 1 year ago

I believe the thinking here is that if you're on a classic theme you're restricted to using classic menus. If you want to take advantage of the navigation block you'd need to update to a block theme. I can see that in some cases there might be a need to add a navigation block to a classic theme, but this feels like a lower priority item so not something we're likely to work on soon.

spencer-j commented 1 year ago

@scruffian: I'm working on a FSE theme and use widgets. In this case widgets should not be accessible or addable to FSE/Block themes at all. As the core/navigation was available in the widget, what was the justified reason to remove it? right now i can only read "When preparing for 5.9, some folks made changes to ensure that as the navigation block on it's own shouldn't be present in that screen right now"

getdave commented 1 year ago

@talldan Do you recall any reason not to enable core/navigation on the Widgets screen?

As far as I can see we should now be able to safely enable it.

getdave commented 1 year ago

I looked into this and it's deliberately disabled here

https://github.com/WordPress/gutenberg/blob/960f157b904820552a4813219f73ba6ee97508e8/packages/edit-widgets/src/index.js#L77

Perhaps we intentionally did this as it's one of only a few blocks that require entities to function.

Looks like this was added by @noisysocks in https://github.com/WordPress/gutenberg/pull/35979/files#diff-b6ec05011df6210b0fc76d8db93fb2e615dc7c97d0fc0ce664e8f1d3c53768c4R59.

Maybe he can also shed some light on the decision process behind this?

noisysocks commented 1 year ago

The multi-entity save flow hasn't been implemented in the widgets screen and so blocks that use entities (Template Part, Navigation, etc.) won't work. We therefore disable them.

The challenging part of implementing multi-entity saving in widgets is that we need to make it work in the customiser which has a considerably different UI and technical architecture.

Aside from that, it's something that is doable but just hasn't been done yet 😅

getdave commented 1 year ago

Thanks @noisysocks.

So next steps here are:

The team working on Navigation block are currently focused on the UX of the block so I don't see us getting around to working on this anytime in the near future.

Perhaps @priethor can consider if/when this should be placed on the wider Gutenberg project roadmap?