- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.6k
Closed as duplicate of#72195
Copy link
Labels
[Feature] Block TransformsBlock transforms from one block to anotherBlock transforms from one block to another[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
What problem does this address?
We're considering moving the blockCommentId attribute from the root level into metadata.
While working on #71921, I noticed that block custom names and block comment ID disappear when a block is transformed.
This occurs when using certain attributes when executing createBlock, like this:
transform: ( { content } ) => {
	return createBlock( 'core/test', {
		content,
	} );
},What is your proposed solution?
To properly maintain both the custom names and block comment IDs, we will probably need to go through all of the transforms.js files and change the code to something like this:
transform: ( { content, metadata } ) => {
	return createBlock( 'core/test', {
		content,
		metadata: getTransformedMetadata( metadata, 'core/test' ),
	} );
},Metadata
Metadata
Assignees
Labels
[Feature] Block TransformsBlock transforms from one block to anotherBlock transforms from one block to another[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended