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

[WP 6.6 beta1] Trying to rename posts w/o registered titles creates a WSOD #62314

Closed
them-es opened this issue Jun 5, 2024 · 2 comments
Closed
Labels
[Type] Bug An existing feature does not function as intended

Comments

@them-es
Copy link
Contributor

them-es commented Jun 5, 2024

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

  1. Register a custom post type - don't include "title" in the "supports" args:
    https://developer.wordpress.org/reference/functions/register_post_type/

Example:

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,
    )
);
  1. Publish a new post
  2. Now reload the page
  3. Click on "Rename" in the 3-dot menu next to "No Title" (see screenshot below)
  4. 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

image

Output:
image

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

@them-es them-es added the [Type] Bug An existing feature does not function as intended label Jun 5, 2024
@t-hamano
Copy link
Contributor

t-hamano commented Jun 5, 2024

Thanks for the report. #62248 should solve this problem.

@them-es
Copy link
Contributor Author

them-es commented Jun 5, 2024

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.

Thanks!

@them-es them-es closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
2 participants