-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Multiple navigation menus are being created #38157
Comments
Thanks for reporting this. To explain what's happening:
The duplicates should only happen if when exiting the site editor the warning about unsaved changes is ignored. I agree it is confusing, and something that should be improved. I did mention the problem with duplicate menus in my feedback on the PR - #36024 (comment) - but this is the direction others wanted to take. Perhaps the best option is if the block could check whether another menu with the same content already exists before creating a new one. Maybe menus created this way could have some kind of flag (e.g. |
Why do we have to save immediately if there have been no changes? Why is there even a "dirty" state? Is there a way we can adjust the flow so that we only save a new menu if there have been changes? |
It would be good to try. Saving is asynchronous, so it would have to be pretty seamless and not interupt the user's editing. It still only mitigates the issue though, the user can choose not to save changes in the site editor (which avoids assigning the |
I've outlined a couple of options for solving or improving this in #39489. |
IN #39883 weve now updated things so that Nav blocks that:
...will only be converted to a Navigation Menu entity if the user modifies the original blocks. So if your Theme includes a Nav block it won't get saved as a Navigation Menu until you click on it and make some changes to the menu items. At that point it saves. This should avoid so many menus being created because no longer does focusing the Nav block cause a Nav Menu to be created. |
With #39883 closed - and no further reports of this kind - I'm going to close this issue as well. |
Description
I'm running 5.9-RC3 with Twenty Twenty Two theme. Gutenberg plugin is not installed.
Multiple navigation menus are being created even though I have not added any, when I go between the new site editor and the manage menus screen.
Step-by-step reproduction instructions
At no point during this process have I clicked 'Add new' on the menus page, clicked any 'Publish' buttons, etc.
Screenshots, screen recording, code snippet
Environment info
WordPress 5.9-RC3
Twenty Twenty Two theme
Gutenberg not installed
MacOS 12.1
PHP 7.4 (site is running locally using Valet)
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
The text was updated successfully, but these errors were encountered: