Conversation
Contributor
Author
|
As this bug exists in WP 6.2 should I include the |
|
Size Change: -1 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in ebee8b4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4881795694
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes a bug whereby importing a Classic Menu would not trigger a dirty state on the resulting
wp_navigationentity and thus the new Navigation could not be saved.Change causes newly imported Navigation Menu to show in the sidebar when you click "Save" in the editor.
Fixes #49718
Why?
It looks like #43580 introduce a regression.
The bug is that when the classic menu is converted into a (block based) Navigation Menu the call to
editEntityRecorddoes not set the status topublish. Rather it simply sets it to whatever the initialstatusargument was that was passed to the "convert" function:gutenberg/packages/block-library/src/navigation/edit/use-convert-classic-menu-to-block-menu.js
Line 100 in 44308e7
This means that the entity never becomes "dirty" and thus never gets included in the "saved" changes when you click "Save" in the editor.
The clue is in the comment where it references
publishas the expected state change:gutenberg/packages/block-library/src/navigation/edit/use-convert-classic-menu-to-block-menu.js
Lines 88 to 103 in 44308e7
How?
The fix is to change the status argument back to a hard coded string
publishin theeditEntityRecordcall.Testing Instructions
Follow instructions in #49718.
On this branch once you you complete this step...
...the newly imported Classic Menu should be included in the sidebar when you click "Save" in the editor. Clicking and confirming the "Save" should cause the Navigation to update on the front of the site.
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2023-05-04.at.11-36-30.mp4