Make WordPress Core

Opened 8 years ago

Closed 6 years ago

#25734 closed defect (bug) (worksforme)

theme-editor non functional whith a child theme

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


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 (3)

#1 @Latz
8 years 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

#2 @nacin
8 years 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?

#3 @chriscct7
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

No reporter response in 2 years and unable to reproduce. Feel free to reopen if steps to reproduce can be provided

Note: See TracTickets for help on using tickets.