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

Core Data: Can't open editor if post type rewrite slug is non-Latin #68793

Closed
t-hamano opened this issue Jan 21, 2025 · 5 comments
Closed

Core Data: Can't open editor if post type rewrite slug is non-Latin #68793

t-hamano opened this issue Jan 21, 2025 · 5 comments
Labels
[Package] Core data /packages/core-data [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Jan 21, 2025

Description

Originally reported in Core: https://core.trac.wordpress.org/ticket/62776

If you register a CPT with a rewrite slug that uses non-latin characters then when you click a back-end link to edit such a post the editor fails to load and displays a message "You attempted to edit an item that doesn't exist. Perhaps it was deleted?".

Does not happen in WordPress 6.6.2, happens in WordPress 6.7+

After checking with git bisect, this issue seems to be related to #63430.

Step-by-step reproduction instructions

  • Launch WordPress version 6.6.2.
  • Disable the Gutenberg plugin.
  • Add the following code somewhere:
    function my_custom_post_type() {
    	$recipe_args = array(
    		'label' => 'Recipes',
    		'public' => true,
    		'rewrite' => array('slug' => 'рецепт'),
    		'show_in_rest' => true,
    	);
    	register_post_type('recipe', $recipe_args);
    }
    add_action('init', 'my_custom_post_type');
  • Change the permalink to "Post name".
  • Open a new post of the post type "Recipes".
  • You should be able to edit correctly.
  • Enable the Gutenberg plugin.
  • Open a new post of the post type "Recipes".
  • You should see the message You attempted to edit an item that doesn't exist. Perhaps it was deleted?.

Screenshots, screen recording, code snippet

15463ef930a8f93124f3e20377b4ef3e.mp4
@t-hamano t-hamano added [Package] Core data /packages/core-data [Type] Bug An existing feature does not function as intended labels Jan 21, 2025
@t-hamano
Copy link
Contributor Author

t-hamano commented Jan 21, 2025

@Mamaduka Do you know anything about this issue? I've been debugging around this and it looks like it's not getting the allowed methods correctly.

@carolinan
Copy link
Contributor

Thank you for bringing this over.

@carolinan
Copy link
Contributor

I was searching for something else and noticed this: #67358

@t-hamano
Copy link
Contributor Author

t-hamano commented Jan 21, 2025

Let's close this issue and add #67358 to the project board move forward with #67358.

@Mamaduka
Copy link
Member

Thanks for checking the duplicates, @carolinan!

@t-hamano, do you mind sharing your findings in the original issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Core data /packages/core-data [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants