WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 17 months ago

#25734 new defect (bug)

theme-editor non functional whith a child theme

Reported by: YS1 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.7
Component: Themes Keywords: reporter-feedback
Focuses: Cc:

Description

Hi,
I just created a simple child theme, named ys, before upgrading my Twentythirteen theme.
Since I have started using this child theme, I cannot use the built-in theme editor : loading wp-admin/theme-editor.php brings a message "Désolé, on ne peut pas modifier les fichiers avec « .. » dans le nom.", which in admin-fr_FR.po is

#: wp-admin/includes/file.php:180
msgid ""
"Sorry, can’t edit files with “..” in the name. If you are "
"trying to edit a file in your WordPress home directory, you can just type "
"the name of the file in."

This seems to be fired from line 76 of theme-editor.php. Further investigation shows that the default file that the editor tries to display is wp-content/themes/ys/./style.css.
The presence of "./" in the path is disliked by validate_file() in wp-includes/functions.php
It seems to come from the fact that WP_Theme::get_stylesheet_directory() returns "wp-content/themes/ys/." (with the dot at the end) when called on my child theme.

Change History (2)

comment:1 @Latz17 months ago

  • Keywords 2nd-opinion added

Hello YS1,

Sorry you never got a response.

Unfortunately I can't reproduce your bug. Trying to open a child theme in the editor works for me. Even if I'm playing around with the name and add ..or ./ to the theme name.

Though there seem to be other people having a related problem #25924

comment:2 @nacin17 months ago

  • Keywords reporter-feedback added; 2nd-opinion removed

It seems like your stylesheet directory being "ys/." is the real problem here. I honestly don't know how that can occur. That's definitely not right. Any feedback for how that happens?

Note: See TracTickets for help on using tickets.