Skip to content

Site Editor: renaming a navigation menu resets its content #59991

@jsnajdr

Description

@jsnajdr

Steps to reproduce:

  1. In the Site Editor, go to the Navigation page
  2. Verify there is a a navigation item there, and its content is a Page List block, showing the list site's pages.
  3. In the navigation's context menu, select Rename
  4. Rename the navigation

Result: the navigation is not only renamed, but its content is also reset to empty string ('').

Here is a video:

Screen.Recording.2024-03-19.at.13.33.56.mov

Note that the "Sample Page" item (it's part of the Page List block) has disappeared after the rename.

The REST request to rename looks like this:

Screenshot 2024-03-19 at 13 40 21

and this is the response:

Screenshot 2024-03-19 at 13 41 53

Note that not only the title field has changed, but also the content has been reset.

@tellthemachines Maybe there is something wrong with the WP_Navigation_Fallback class in Core? If I understand it correctly, wp_navigation is just another custom post type, and its REST requests are handled by the vanilla posts controller. Editing individual fields should work without resetting the others. It's only WP_Navigation_Fallback that patches the schema somehow, including the content.* fields.

Metadata

Metadata

Assignees

Labels

[Block] NavigationAffects the Navigation Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions