You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug occurs in the new Post title rename control introduced in WP 6.6 when a custom post has been registered w/o supports title arg (see step 1 below).
Renaming posts that don't support titles should not be possible.
register_post_type(
'my-custom-post',
array(
'labels' => array(
'name' => esc_html__( 'My custom post (no title)' ),
'singular_name' => esc_html__( 'My custom post (no title)' ),
),
'public' => true,
'show_in_rest' => true,
'has_archive' => false,
'supports' => array( 'editor' ), // Note that "title" is not included here!
'show_ui' => true,
)
);
Publish a new post
Now reload the page
Click on "Rename" in the 3-dot menu next to "No Title" (see screenshot below)
A WSOD appears with the following error message (see screenshot below)
TypeError: Cannot read properties of undefined (reading 'rendered')
at RenderModal (/wp-includes/js/dist/editor.js?ver=acb42d08bcf2259eef90:25933:144)
at renderWithHooks (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:15486:18)
at mountIndeterminateComponent (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:20098:13)
at beginWork (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:21621:16)
at beginWork$1 (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:27460:14)
at performUnitOfWork (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:26591:12)
at workLoopSync (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:26500:5)
at renderRootSync (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:26468:7)
at recoverFromConcurrentError (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:25884:20)
at performSyncWorkOnRoot (webpack://WordPress/./node_modules/react-dom/cjs/react-dom.development.js?:26130:20)
Screenshots, screen recording, code snippet
Output:
Environment info
WordPress 6.6 beta1
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered:
You're right @t-hamano - the PR you linked should fix this bug and already got "backport" labeled. So, let's close this issue and follow the discussion in the open PR.
Description
The bug occurs in the new Post title rename control introduced in WP 6.6 when a custom post has been registered w/o supports
title
arg (see step 1 below).Renaming posts that don't support titles should not be possible.
Step-by-step reproduction instructions
https://developer.wordpress.org/reference/functions/register_post_type/
Example:
Screenshots, screen recording, code snippet
Output:
![image](https://cdn.statically.io/img/private-user-images.githubusercontent.com/10208534/336699958-02b60e2e-7c18-4b11-94b3-e0400bd63644.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI5NjQ5NTYsIm5iZiI6MTcyMjk2NDY1NiwicGF0aCI6Ii8xMDIwODUzNC8zMzY2OTk5NTgtMDJiNjBlMmUtN2MxOC00YjExLTk0YjMtZTA0MDBiZDYzNjQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA2VDE3MTczNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4MjJlODYyODljNjMyMTA3NmVhMTNkZTVhODZhZGQzM2YyYjRjMTE5MjEwMWU0MTdlMzgzZjJmYThjMmMzYWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.x5xDB_DLg_s5scck7M5daqSr49CRKSEKTgvQFwuLf34)
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: