Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#10974 closed defect (bug) (fixed)

Theme Editor broken

Reported by: richardmtl's profile richardmtl Owned by:
Milestone: 2.9 Priority: normal
Severity: major Version: 2.9
Component: General Keywords: has-patch tested commit
Focuses: Cc:

Description

Hi, this is my 1st bug report, please ask if you need more details.

I have a blog that I use only for testing new plugins and themes, so I decided to try out 2.9 to see what's new. I installed a nightly today, and when I go to the Theme Editor page, I get the error "Oops, no such file exists! Double check the name and try again, merci.". I did a quick search on this message and suspected that the qtranslate plugin was the problem, so I deactivated it, but I still get the same error message. I have many plugins (only some of which are currently active) and many themes installed in this blog, so I do not know where to start to try to debug. I even deactivated all and used Kubrik, but I still get the same error. Please give me some guidance as to how I can help debug this issue.

Attachments (2)

10974.diff (411 bytes) - added by sivel 15 years ago.
Theme files are full paths now. Don't prefix WP_CONTENT_DIR to $file in get_real_file_to_edit.
10974.2.diff (516 bytes) - added by sivel 15 years ago.
Alternate patch to not even use get_real_file_to_edit.

Download all attachments as: .zip

Change History (9)

#1 @scribu
15 years ago

  • Keywords needs-patch added; theme editor edit themes removed
  • Milestone changed from Unassigned to 2.9
  • Summary changed from Error editing Theme from Theme Editor to Theme Editor broken
  • Version set to 2.9

Was able to reproduce this in trunk: selecting any file from the right produces the same error.

Might be related to #10467.

@sivel
15 years ago

Theme files are full paths now. Don't prefix WP_CONTENT_DIR to $file in get_real_file_to_edit.

#2 @sivel
15 years ago

  • Cc matt@… added
  • Keywords has-patch tested added; needs-patch removed

get_real_file_to_edit is currently only used in theme-editor.php. If we were to start using this file for other items we could run into problems with this modification if $file is not a full file system path. Just something to keep in mind for the future. To be honest we could probably remove the use of this function all together since it is really doing nothing for us at this point, except passing back exactly what we give it.

Let me know what you think, I can easily create a new patch to not use get_real_file_to_edit.

@sivel
15 years ago

Alternate patch to not even use get_real_file_to_edit.

#3 @sivel
15 years ago

Took like 15 seconds to create the other patch. So here it is. Take your pick.

#4 @johnhennmacc
15 years ago

Tried the second patch. It seems to work for me.

#5 @scribu
15 years ago

  • Keywords commit added

Second patch working here too.

#6 @westi
15 years ago

Hmm..

Not sure the urls look pretty now though.

Gonna commit something different which works for my tests and has urls more like the old style.

#7 @automattor
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12063]) Display a smaller filename in the theme editor urls and make theme files editable again. Fixes #10974.

Note: See TracTickets for help on using tickets.