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

[WP6.4] Rename UI is displayed in the advanced panel of all blocks #55953

Closed
t-hamano opened this issue Nov 8, 2023 · 11 comments
Closed

[WP6.4] Rename UI is displayed in the advanced panel of all blocks #55953

t-hamano opened this issue Nov 8, 2023 · 11 comments
Assignees
Labels
[Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Nov 8, 2023

Description

In the latest Gutenberg, rename UI is enabled for almost all blocks, but as of WordPress 6.4, only group blocks should be renameable. However, except for group blocks, there is a rename UI in the Advanced panel for almost all blocks.

If you enter a new block name in this panel, it will not be reflected in the list view. It also doesn't seem to be saved as attributes.

The rename menu is not displayed in the list view or block toolbar menu unless it is a group block.

Step-by-step reproduction instructions

  • Inserts some block other than the group block.
  • Open the Advanced panel and verify that the "Block Name" field is present.
  • The block name in the list view should not change when you enter text.

Screenshots, screen recording, code snippet

b4cfd8596298506cf2ad2a7b0f9a6ae6.mp4

Environment info

WordPress 6.4 (General Release Version)

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

@t-hamano t-hamano added the [Type] Bug An existing feature does not function as intended label Nov 8, 2023
@Mamaduka Mamaduka added the [Package] Block editor /packages/block-editor label Nov 8, 2023
@Mamaduka
Copy link
Member

Mamaduka commented Nov 8, 2023

This was introduced during refactoring in #55604. The control uses hasBlockSupport( name, 'renaming', true ); check, which doesn't ship with WP 6.4.

cc @getdave

@getdave
Copy link
Contributor

getdave commented Nov 8, 2023

That's a bug if it's happenning for 6.4. Renaming support for all blocks should be in Gutenberg trunk only.

@getdave
Copy link
Contributor

getdave commented Nov 8, 2023

Fix for this will need to land (I assume) in 6.4.1.

diff --git a/packages/block-editor/src/hooks/block-rename.js b/packages/block-editor/src/hooks/block-rename.js
index d8f414a3e9..60d13760f2 100644
--- a/packages/block-editor/src/hooks/block-rename.js
+++ b/packages/block-editor/src/hooks/block-rename.js
@@ -16,7 +16,11 @@ export const withBlockRenameControl = createHigherOrderComponent(
 	( BlockEdit ) => ( props ) => {
 		const { name, attributes, setAttributes, isSelected } = props;
 
-		const supportsBlockNaming = hasBlockSupport( name, 'renaming', true );
+		const supportsBlockNaming = hasBlockSupport(
+			name,
+			'__experimentalMetadata',
+			false
+		);
 
 		return (
 			<>

Pinging @mikachan for advice on next steps.

This happened as the result of changes in trunk becoming out of sync with 6.4.

@mikachan
Copy link
Member

mikachan commented Nov 8, 2023

Thanks for the ping! I believe the next steps to include a fix for 6.4.1 would be to create a PR against the wp/6.4 branch with the above change and add the Backport to WP Minor Release label.

@getdave
Copy link
Contributor

getdave commented Nov 9, 2023

Thanks. Working on a PR now.

@MadtownLems
Copy link

It looks like this missed 6.4.1. Can someone confirm it's on the list for 6.4.2? A new field that does nothing (and has no explanatory text) is pretty confusing 😅

@getdave
Copy link
Contributor

getdave commented Nov 20, 2023

@mikachan Did we not land the fix in 6.4.1?

@mikachan
Copy link
Member

This fix didn't go out with 6.4.1 as that was an emergency release for a single fix on the Core side. This fix will be going out with 6.4.2, alongside some other GB package updates: WordPress/wordpress-develop#5665

@getdave getdave moved this from Needs Review to Done in Automattic team Ignite's project board Nov 21, 2023
@t-hamano
Copy link
Contributor Author

Update: WordPress 6.4.2 was released on December 6th, but this issue does not seem to be resolved. My understanding is that 6.4.2 is a maintenance security release. As stated in this core ticket, it will be fixed when 6.4.3 is released.

@mikachan
Copy link
Member

My understanding is that 6.4.2 is a maintenance security release. As stated in this core ticket, it will be fixed when 6.4.3 is released.

This is my understanding, too 👍

@t-hamano
Copy link
Contributor Author

Now that WordPress 6.4.3 has been released, I tested this issue again. This issue appears to have been fixed, so I would like to close it. Thank you everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
Development

No branches or pull requests

5 participants