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 Submenu Block: Mark Navigation Submenu parent as invalid when linked page is deleted #69138

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

dhruvikpatel18
Copy link
Contributor

@dhruvikpatel18 dhruvikpatel18 commented Feb 11, 2025

Closes #44760

What?

Ensures that when the parent page of a Navigation Submenu block is deleted, it is marked as (Invalid) in the editor, similar to other navigation links.

Why?

Currently, when a Navigation Submenu has a parent item linked to a page, and that page is deleted, the editor does not indicate that the link is invalid. This behavior is inconsistent with other navigation links, which display (Invalid) when their linked page is removed.

This issue affects both Classic and FSE themes, and results in the editor displaying an outdated menu structure, even though the front-end correctly removes the deleted page’s submenu.

Testing Instructions

  1. Add a Navigation block to a site.
  2. Create a submenu, setting its parent item to link to an existing Page.
  3. Publish the content.
  4. Delete the parent page from the site.
  5. Refresh the editor where the Navigation block is used.
  6. Expected Result: The submenu parent item should now display (Invalid) next to its label in the editor.

Screenshots or screencast

Before

Screen.Recording.2025-02-11.at.2.30.00.PM.mov

After

Screen.Recording.2025-02-11.at.2.43.04.PM.mov

@dhruvikpatel18 dhruvikpatel18 changed the title Fix: Mark Navigation Submenu parent as invalid when linked page is de… Navigation Submenu Block: Mark Navigation Submenu parent as invalid when linked page is de… Feb 11, 2025
@dhruvikpatel18 dhruvikpatel18 changed the title Navigation Submenu Block: Mark Navigation Submenu parent as invalid when linked page is de… Navigation Submenu Block: Mark Navigation Submenu parent as invalid when linked page is deleted Feb 11, 2025
@dhruvikpatel18 dhruvikpatel18 marked this pull request as ready for review February 11, 2025 10:39
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @stacimc.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: stacimc.

Co-authored-by: dhruvikpatel18 <[email protected]>
Co-authored-by: getdave <[email protected]>
Co-authored-by: cuemarie <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended [Block] Submenu Affects the Submenu Block - for submenus in navigation and removed [Block] Navigation Affects the Navigation Block labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation Submenu's block is not marked as Invalid when page is deleted
2 participants