-
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
Widget Importer: ensure it works with importing menus #47285
Comments
The Menu and Meta core widgets don't have transformations to blocks; it is the reason it's skipped during import. See #45509 (comment). The Legacy Widget block doesn't work in Site Editor; We try to transform widgets into blocks; if this fails, we'll skip them and display the notice. @noisysocks, do you remember the complications of adding the Menu widget transformation? |
There isn't a transformation for the Meta widget because we have no analogous block for it. Should there be a Meta block, @mtias? There isn't a transformation for the Menu widget because there was no need for one in the Widgets Editor which currently does not support the Navigation block (see #36469 for why). It should be easy enough to add a Menu widget → Navigation block transformation but continue to disable the Navigation block in the Widgets Editor. |
Thank you for the context, @noisysocks! |
I started looking into this and the difficult bit is that we need to load the classic menu in order to transform it but unfortunately we don't yet support async transforms (#14755). We can either implement async transforms or add some wacky |
I personally would preferer using async transforms, and the feature would also be helpful in other places. The Navigation block is complicated; it doesn't seem right to add extra logic just for this case. |
Yeah agreed. |
@annezazu, I think it makes sense to punt this for WP 6.3 and implement it properly with async transformations. |
Sounds good. I trust your read here! |
I no longer think async transforms are a practical option. See #14755 (comment). I started trying to solve this using the approach I outlined in that comment but then ran into a drawback that I don't like which is that doing this involves fetching all of the menus and menu items when the block editor is initialised. Back to the drawing board 😅 |
This was found as part of the FSE Outreach Program's twentieth call for testing:
I could only replicate issues with the menu import using GB 15.0 and WordPress 6.1.1:
The text was updated successfully, but these errors were encountered: