[wp-trac] [WordPress Trac] #57973: Can not delete custom template when name contains non-Latin characters
WordPress Trac
noreply at wordpress.org
Mon Jul 1 19:02:33 UTC 2024
#57973: Can not delete custom template when name contains non-Latin characters
----------------------------------------------+----------------------------
Reporter: funway | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: REST API | Version: 6.1.1
Severity: normal | Resolution:
Keywords: has-testing-info has-screenshots | Focuses: rest-api
----------------------------------------------+----------------------------
Changes (by ironprogrammer):
* keywords: has-testing-info has-screenshots close => has-testing-info
has-screenshots
* focuses: javascript, rest-api => rest-api
Comment:
I am unable to reproduce this issue with templates created in WP 6.4 and
up. Since 6.4, non-Latin characters are removed from saved template slugs.
E.g. a template named `กรุงเทพฯ` is now by default saved as `wp-custom-
template`.
However, for a template with non-Latin characters created in <= 6.3, it
cannot be deleted in 6.5.5. In 6.3, a template named `กรุงเทพฯ` is saved
with a slug of `wp-custom-template-กรุงเทพฯ`, which in newer WP versions
cannot be modified or deleted.
Because [https://core.trac.wordpress.org/ticket/57329 saving templates
with non-Latin characters was added in 6.2], I feel this report is still
valid, as there is somewhat of a backward-compatibility break with the
change in 6.4. It seems endpoint support for non-Latin characters or some
type of migration for now "invalid" template slugs should be considered.
As of today, one cannot "clean up" these older templates directly in the
UI.
I've removed `close` for additional test and upgrade input and discussion
around the backward-compat impact.
== Reproduction Report
**tl;dr** Can repro in upgrade from <6.4, but not for templates created in
6.4+.
=== Environment
==== WordPress Playground
- PHP 8.0, 6.2 thru 6.6-RC1, Twenty-Twenty Two
==== Local (for post-upgrade test)
- Hardware: MacBook Pro Apple M1 Pro
- OS: macOS 14.5
- Browser: Safari 17.5
- Server: nginx/1.27.0
- PHP: 8.2.20
- SQLite: 3.43.2
- WordPress: 6.3 and 6.5.5
- Theme: twentytwentytwo
=== Actual Results
- ❌ In 6.4+, a template created with non-Latin characters in name is
deleted successfully. No 404 responses observed.
- ✅ In <= 6.3, a template created with non-Latin characters in name
cannot be deleted after upgrading to 6.4+. Attempts to modify or delete
the template result in a 404.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57973#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list