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: Nested block-based menu items are deleted and re-created on each save #35047

Closed
Tracked by #29102
adamziel opened this issue Sep 22, 2021 · 1 comment

Comments

@adamziel
Copy link
Contributor

adamziel commented Sep 22, 2021

As noted in 34541:

The mapMenuItemsToBlocks function assigns the __internalEntityRecord attribute to all the blocks representing classic menu items. This way we can match blocks with menu items and update the correct ones.

Unfortunately, it doesn't assign __internalEntityRecord to nested blocks. The save function "thinks" it sees new menu items and that it doesn't see the old ones. This results in deleting and re-creating the same menu items on each save:

if ( menuItem.type === 'block' ) {
const [ block ] = parse( menuItem.content.raw );
if ( ! block ) {
return createBlock( 'core/freeform', {
content: menuItem.content,
} );
}
return block;
}

cc @talldan

@Mamaduka
Copy link
Member

Closing the issue since the editor is no longer maintained and has been removed from the project.

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

No branches or pull requests

2 participants