WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 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:

Description

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)

comment:1 @ryan6 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.

comment:2 @kreativdienst6 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?

comment:3 @kreativdienst6 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.

comment:4 @hakre6 years ago

  • Keywords needs-patch added; media upload path removed

comment:5 @Denis-de-Bernardy6 years ago

  • Milestone changed from 2.8 to 2.9

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

comment:6 @hakre6 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.

comment:7 @azaozz5 years ago

  • Milestone changed from 2.9 to 3.0

No patch.

comment:8 @gazouteast5 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.

Gaz

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.

comment:9 @nacin5 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.

comment:10 @gazouteast5 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.

comment:11 @nacin5 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.

comment:12 @ryan5 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.