[wp-trac] [WordPress Trac] #54596: Block theme with period in name causes blank editor

WordPress Trac noreply at wordpress.org
Mon Dec 20 17:09:48 UTC 2021

#54596: Block theme with period in name causes blank editor
 Reporter:  mkaz                               |       Owner:
                                               |  hellofromTonya
     Type:  defect (bug)                       |      Status:  reopened
 Priority:  normal                             |   Milestone:  5.9
Component:  REST API                           |     Version:  trunk
 Severity:  normal                             |  Resolution:
 Keywords:  has-testing-info has-patch commit  |     Focuses:
Changes (by hellofromTonya):

 * keywords:  has-testing-info has-patch => has-testing-info has-patch


 Theme directories named with characters like `{@!$,^~"}` and `&=%` are
 **''likely far edge cases''**. Theme directories named with localized
 characters like `é` are not.

 = Test Report

 - OS: macOS Big Sur 11.6
 - Browsers: Edge
 - Theme: Copies of TT2 with directory name changed (see test info)
 - Plugins: None
 - WordPress: trunk
 - Patch: [https://github.com/WordPress/wordpress-develop/pull/2064 PR
 - Localhost: wp-env

 == Steps

 Using the [#comment:40 steps as a starting point]:

 1. Prepare first theme:
    * Rename `wp-content/themes/tt2é [v1.0.0] {@!$,^~}(-_-)/` to `wp-
    * Open `style.css` and change the `Theme Name` to `ŧĥémé-1.0.0`
 2. Prepare second theme:
    * Rename `wp-content/themes/subdir/tt2é [v1.0.0](-_-)/` to `wp-
    * Open `style.css` and change the `Theme Name` to `subdir/ŧĥémé-1.0.0`

 Now test:
 1. Use `trunk` (not the PR)
 2. Go to Appearance > Themes
 3. Activate the `subdir/ŧĥémé-1.0.0` theme (the one in the subdirectory)
 4. Click its "Customize" button
 Actual behavior: Site Editor does not load and has a 404 with the
 following error message: `{"code":"rest_no_route","message":"No route was
 found matching the URL and request method.","data":{"status":404}}` (To
 view the error, open browser's Network tab, refresh the page, scroll down
 the 404 item in the list, click on it to open a panel, and then click on
 the Response tab to view the JSON response.)
 5. Apply PR 2064
 6. Refresh the Site Editor.
 Expected behavior: The Site Editor should load and the header background
 should be a bright green color.

 == Results

 - Yes, can reproduce the 404 error before the PR is applied ✅
 - With the PR 2064 applied, resolves the endpoint (no error) and Site
 Editor opens as expected ✅

 Marking for commit.

Ticket URL: <https://core.trac.wordpress.org/ticket/54596#comment:41>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list