Go to your file manager through your servers control panel and make sure the files are writable.
i just upgraded to version 2.0.4 and now have the same problem with a theme I’ve been able to edit in 2.0.4. All the files including the theme directory are 777.
Directory – 777, files should be 666.
(and because you’ll not change back them after every small edit, you’ll leave your blog completely vulnerable for any hacker out there. Don’t use it. Edit the template files on your computer!)
I noticed this is a regression present with 2.0.4 and 2.1 Alpha 2. The theme that was causing a problem has brackets in the directory name(for example, themename[modification]), and for some reason upon clicking “Update File,” the brackets are stripped out of the $files variable. Because of this, the value for $files doesn’t match the value present in $allowed_files and the function validate_file returns 3, which in turn results in validate_file_to_edit doing a “die(__(‘Sorry, that file cannot be edited.’));”. All of these variables I am referring to are in admin-functions.php.
I haven’t been able to track down yet where the brackets are stripped out, but it has to be something new to 2.0.4 and 2.1 Alpha 2. I tried fresh installs of 2.0.3, 2.0.4, and 2.1 Alpha 2, and 2.0.3 is the only installation that works properly.
As a workaround, I renamed the theme directory to not have any brackets in it.
I plan on posting a bug report shortly.
feanor, does your theme’s directory happen to have brackets in it, or is my issue completely unrelated?
Maybe having brackets in a directory name is not the wisest thing to do…
There really isn’t much need for brackets in a directory name..!? What’s the point of it anyways..? =/
It’s bad enough now, helping people upload their themes properly..sigh.. Brackets would just add to the problem even more. [rolls eyes]..people..I tell ya lol!
Last time I checked, a bracket is a valid text character for use in a file/directory. If I have a valid directory name, it should be handled correctly.
Previous comments are basically saying parenthesis or underscores shouldn’t be handled either since there isn’t “much need” for them. Just because something is seldom used does not mean it shouldn’t be handled correctly.
Anyways, the bug report is filed.
I know it’s somewhat rare to use a bracket, but if WordPress isn’t going to handle the use of brackets properly, it should at least prompt the user to rename the directory to something that WordPress finds acceptable. If this isn’t the case, then it is a bug, plain and simple, and should be addressed.
I posted the bug report to the following page:
I later found out where the troublesome code is, which you can see from the above link is a section of code in wp-includes/pluggable-functions.php .
For those having problems, the easiest fix for now would be to rename the directory that is causing the issues. Otherwise, either revert to the 2.0.3 code in pluggable-functions.php (as mentioned in the bug ticket link above), or wait until the devs officially fix the problem.
no offense, but moshu and spencerp, maybe you could can the sarcasm and holier-than-thou attitude when trying to help some of us in the forums. There are quite a few people who are new at this and might not understand why you shouldn’t have your files set at 777 or why putting prackets in file names “is not the wisest thing to do…”
just my two cents.
Trasnam, I know I’m going to sound totally noobish here, but I’m not entirely sure what you mean.
The theme in question is ChaoticSoul v.1.0 (as displayed in the themes dir). Here’s the odd thing – even after getting the error, when I look at the template file I just edited and got the error on, the changes are saved…
Let me know where/what to look for and I’ll be happy to provide any information I can.
Just as a point of reference, the two themes that come default with WP (classic and default) both work with no problems.
And as a side note, I didn’t leave my dir at 777 🙂 I was just trying to state that changing perms didn’t help with the problem.
Unfortunately this problem not only affects brackets. It affects spaces also (among other characters, like parenthesis, for instance).
I suggest for now to rename the directory to ChaoticSoul, or ChaoticSoul_v1.0.0 or the like. It should then work properly.
It all comes down to the preg_replace line in wp-includes/pluggable-functions (that I mentioned in the bug ticket) that limits what characters are allowed. Apparently this fixes some IIS bug, but messes things up for us.
trasnam – worked like a charm. simple fix (without being a coder, i tend to like those the best).
I’m glad I could help. Who would have thought that something as innocent as a space in the directory name would be causing the problem?
This “fix” *might* make it into the SVN branch/ and trunk/, but..won’t be publically accessible per se..unless they add it quick, some how into the downloadable zip or tar for 2.0.4. =/ (And of course..the people that know how to grab the SVN copies lol..but, it’s cool though. )
But, I’ll check out the “fix” or whatever then k. =) See what happens.. =p Congrats on taking this upon yourself.. =)
- The topic ‘Cant edit a theme’ is closed to new replies.