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

Fix fallback not rendering #49576

Merged
merged 2 commits into from
Apr 4, 2023
Merged

Fix fallback not rendering #49576

merged 2 commits into from
Apr 4, 2023

Conversation

draganescu
Copy link
Contributor

@draganescu draganescu commented Apr 4, 2023

What?

Removes a useless check for empty fallback meny blocks.

Why?

#48602 which reverted #47684 failed to remove the code at 8548085#diff-90cb5b64c95087ded3c7bb160e38189c8499b0f14f61beb884c887452449fa12R495

This code now prevents fallnack page list navigation from rendering on the front end.

How?

Remove the left over check for empty blocks. It only makes sense in the if branch before, where $maybe_fallback may be empty because of block_core_navigation_filter_out_empty_blocks.

Testing Instructions

  1. Make sure to have one page
  2. Delete all navigation block menus (from wp-admin/edit.php?post_type=wp_navigation)
  3. Install and activate the theme Lettre
  4. Check that the front end renders a page list

@draganescu draganescu added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Apr 4, 2023
@draganescu draganescu marked this pull request as ready for review April 4, 2023 10:58
@draganescu draganescu added the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Apr 4, 2023
@github-actions
Copy link

github-actions bot commented Apr 4, 2023

Flaky tests detected in 7ed8a81.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4606794317
📝 Reported issues:

Copy link
Contributor

@MaggieCabrera MaggieCabrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests well and looking at the reverted PR the code makes sense to me

@draganescu draganescu merged commit f5fd962 into trunk Apr 4, 2023
@draganescu draganescu deleted the fix/fallback-not-rendering branch April 4, 2023 17:41
@github-actions github-actions bot added this to the Gutenberg 15.6 milestone Apr 4, 2023
@ryanwelcher
Copy link
Contributor

I just cherry-picked this PR to the release/15.5 branch to get it included in the next release: 3180818

ryanwelcher pushed a commit that referenced this pull request Apr 5, 2023
* remove useless check for empty fallback navigation

* remove useless check for empty fallback navigation
@ryanwelcher ryanwelcher removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Apr 5, 2023
@getdave
Copy link
Contributor

getdave commented Apr 6, 2023

Is there a way to cover this with a test?

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

Successfully merging this pull request may close these issues.

4 participants