Make WordPress Core

Opened 14 months ago

Last modified 14 months ago

#57973 new defect (bug)

Can not delete custom template when name contains non-Latin characters

Reported by: funway's profile funway Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.1.1
Component: REST API Keywords: has-testing-info needs-testing has-screenshots
Focuses: javascript, rest-api Cc:


I can create a custom template whose name contains non-Latin characters.

But when I delete this template.

It failed without any message in the front-end.

I can only find out the error message in the developer tools.

The ajax post request '/wp/v2/templates/theme_nametemplate_name' returns 404.

I think the problem is caused by the two slashes before none-Latin template_name.

To reproduce:

  1. create a new template with non-Latin characters in post editor.
  2. save the template, re-enter a post editor.
  3. choose the template, and click 'edit template'.
  4. open your browser's developer tools with the network tab.
  5. click 'delete template', then you will see the 404 error in your developer tools.

Attachments (2)

SCR-20230323-tlok.png (753.4 KB) - added by funway 14 months ago.
2023-03-23 22.42.26.gif (989.0 KB) - added by funway 14 months ago.

Download all attachments as: .zip

Change History (4)

#1 @costdev
14 months ago

  • Keywords has-testing-info needs-testing has-screenshots added

Hi @funway, welcome to Trac and thanks for opening this ticket and for the steps to reproduce the issue!

Saving templates with non-Latin characters was handled in #57329. It appears that support for deleting these templates should be added if this issue can be reproduced by other contributors.

For now, I'll mark this with needs-testing so that other contributors can verify whether the issue can be reproduced, and we can move forward from there.

#2 @mi5t4n
14 months ago

Testing on WP 6.2-RC4, the templates are being deleted perfectly.

Version 0, edited 14 months ago by mi5t4n (next)
Note: See TracTickets for help on using tickets.