Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#6097 closed defect (bug) (fixed)

Warning</b>: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: No such file or directory in <b>~/wp-includes/js/tinymce/tiny_mce_config.php</b> on line <b>158</b>

Reported by: dd32's profile DD32 Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.5
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

TinyMCE was failing to load on a fresh install, I noticed a JS error in the console, which turned out to be this PHP error.

It causes an error if it cannot create the temp. cache dir, This would happen if the permissions do not allow the folder to be created, Or, if the uploads folder does not allready exist (Which is doesnt on fresh installs it seems).

Atached patch silences error outputs, and attempts to create the upload folder if it does not allready exist.

Attachments (2)

6097.diff (619 bytes) - added by DD32 17 years ago.
6097.2.diff (531 bytes) - added by DD32 17 years ago.

Download all attachments as: .zip

Change History (7)

@DD32
17 years ago

#1 @ryan
17 years ago

This should use wp_upload_dir(). That function finds the right upload directory, makes sure it exists, and makes sure it has the correct perms.

#2 @ryan
17 years ago

And then wp_mkdir_() can be used to make the js_cache directory beneath wp_upload_dir(). Or, we can just wp_mkdir_p() the cache dir directly within wp-content.

#3 @DD32
17 years ago

I was wondering why it was in the upload dir. and not a cache dir or such, I assumed it was because the more lax permissions that are generally enabled for the upload dir in environments which need it.

wp_upload_dir() returns the current month upload folder if WP is set to organise uploads into year/month folders (Which IMO, a lot of people seem to do).

I've updated this to use wp_mkdir_p() instead. as for wp_upload_dir() maybe can return a extra element 'base' (Or something else) which simply returns the upload folder base.

@DD32
17 years ago

#4 @ryan
17 years ago

(In [7159]) Use wp_mkdir_p() to create js cache dir. Props DD32. see #6097

#5 @azaozz
17 years ago

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

wp_mkdir_p() fixes it nicely.

Note: See TracTickets for help on using tickets.