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 editor: Fail loudly when attempting to save unsupported blocks #35045

Closed
Tracked by #29102
adamziel opened this issue Sep 22, 2021 · 2 comments · Fixed by #35993
Closed
Tracked by #29102

Navigation editor: Fail loudly when attempting to save unsupported blocks #35045

adamziel opened this issue Sep 22, 2021 · 2 comments · Fixed by #35993
Assignees

Comments

@adamziel
Copy link
Contributor

adamziel commented Sep 22, 2021

Navigation editor only processes a subset of blocks in the editor, silently omitting anything that's not supported:

const updatedMenuItems = blocksTreeToAnnotatedList( navigationBlock )
// Filter out unsupported blocks
.filter( ( { block } ) => isBlockSupportedInNav( block ) )

It would be useful to log a warning and make any problems there apparent.

@anton-vlasenko
Copy link
Contributor

@adamziel

It would be useful to logging a warning and make any problems there apparent.

When you say it would be helpful to log warnings, do you mean simple browser console warnings?
Or do we need something more complicated?

@adamziel
Copy link
Contributor Author

do you mean simple browser console warnings?

@anton-vlasenko Yup, exactly! Just to let the developers know something is off. I think we could use @wordpress/warning here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants