Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#9907 closed defect (bug) (fixed)

Upload directory in miscellaneous settings wrongly defined

Reported by: kreativdienst Owned by:
Milestone: 3.0 Priority: normal
Severity: minor Version: 2.8
Component: Media Keywords: needs-patch
Focuses: Cc:


When uploading a new image into the media library, image and thumbnails are not shown. This is because the upload path in "miscellaneous" is set to wp-content instead of wp-content/uploads. When changing the path to wp-content/uploads in this setting, uploads are filed and referenced correctly.

Fix: Change upload path in settings to the correct one.

Change History (12)

#1 @ryan
9 years ago

The upload path is set to wp-content by default when safe mode prevents us from creating the uploads subdir. So, the fix might be elsewhere.

#2 @kreativdienst
9 years ago

thanks for the helpful explanation, ryan. however, after setting the correct paths directories could be created on the server without having to change any file permissions (like chmod 777 or anything like that). does the safe mode problem still aplly then?

#3 @kreativdienst
9 years ago

maybe it would be a good idea to add a warning message to make sure people check the filepaths since it is a bit confusing when upload is possible and you don't get an error message. non tech-savvy users might easily be confused and not be able to solve the problem by themselves.

#4 @hakre
9 years ago

  • Keywords needs-patch added; media upload path removed

#5 @Denis-de-Bernardy
9 years ago

  • Milestone changed from 2.8 to 2.9

Punting per discussion during the WP meet-up...

#6 @hakre
9 years ago

Might be related: #10170

It was a umask problem there. AFAIK media upload does not use the filesystem classes but filesystem functions directly.

#7 @azaozz
9 years ago

  • Milestone changed from 2.9 to 3.0

No patch.

#8 @gazouteast
8 years ago

Looking at Ryan's first reply "The upload path is set to wp-content by default when safe mode prevents us from creating the uploads subdir."

Surely that is the error right there? Why is the /uploads/ directory not part of the distro in order that it uploads automatically at install?

Doing it that way, you could set a basic hierarchy for the different media types from minute one = wp-content/uploads/images wp-content/uploads/movies wp-content/uploads/audio wp-content/uploads/documents

PLace a "sample" file in each upload folder type to prevent the issue that some ftp systems will not transfer empty files and folders, and the whole issue is solved regarding initial creation and safemode or not.

Then a tweak to the wp-admin/settings/miscellaneous page layout and php file, and the whole issue is wrapped up except for adding the extra paths to wp-config.php

If I knew how to write up the patches and stuff to meet required standards and procedures, I'd take the ticket and create the patch, unfortunately I don't and so can only pass along my thoughts.


p.s. You've got this as a minor bug - back when WP 2.5 was released, this foxed me for well over a week. My thinking then was that this was no minor bug, it was extremely MAJOR for live-news sites like the one of mine that it most affected.

#9 @nacin
8 years ago

If we can't create the uploads directory, then we also can't create year/month folders and may have issues with file handling as well. Adding an uploads directory to the distro is just masking a problem that ought to be obvious.

#10 @gazouteast
8 years ago

It's a forked problem ...

On one hand you have the regular forums issue of users reporting media paths of wp-adminuploads/blah (notice the double slash) or wp-admin/uploads/uploads/blah (notice the repeated folder name).

On the other hand you're saying the /wp-admin/ folder is non writable by WordPress - sorry, but to me that's a basic folders and users permissions issue, and one reason why hosting services have 24x7 live help buttons on their websites. Doesn't matter what you do with WP code, if the hosts have locked down write permissions to account user only, there's no way your code is getting past that until the user (or hosts) open the permissions up.

Now lets look back at what I suggested ... somewhere on your hard drive you've got a photo of your kids with their granny on holiday - where is it most likely to be? In a folder by year and month, or in a folder called /photos/kids/ ? Hmmm? Why should it be any different on a webspace?

If WP is about being easy, they SOME bits of it should follow normal user behaviour patterns, and splitting different media types is just so natural to most people, that doing the same into WP folders (rather than just by file type extension) is so blatantly intuitive, that I'm surprised it hasn't been done before now.

#11 @nacin
8 years ago

A plugin can easily implement that, just as they used to implement month/year folders before they were included in core.

Point is, that isn't the bug here. I'm not even sure there even is a bug here.

#12 @ryan
8 years ago

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

This changed awhile ago to ignore safe_mode and always use uploads. This should all be fixed now.

Note: See TracTickets for help on using tickets.