#13733 closed defect (bug) (fixed)
MS Main Site Uploads Inconsistency
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 3.0 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Multisite | Keywords: | has-patch reporter-feedback dev-feedback |
| Focuses: | Cc: |
Description
When you have a fresh MS install with no uploads directory set up for the main site, according to the following logic in wp-includes/functions.php:
2129 if ( empty($upload_path) ) {
2130 $dir = WP_CONTENT_DIR . '/uploads';
2131 } else {
2132 $dir = $upload_path;
2133 if ( 'wp-content/uploads' == $upload_path ) {
2134 $dir = WP_CONTENT_DIR . '/uploads';
2135 $main_override = defined( 'MULTISITE' ) && is_main_site();
2136 } elseif ( 0 !== strpos($dir, ABSPATH) ) {
2137 // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
2138 $dir = path_join( ABSPATH, $dir );
2139 }
2140 }
The uploads directory is set to wp-content/uploads with no way of changing it. This differs from the other, non-main sites.
Since the main site is using the uploads directory, it should have the uploads directory setting fields available to change it, just like non-MS WP. Hence patch allows the main site to change the uploads directory just like non-MS WP.
Attachments (3)
Change History (15)
#2
in reply to:
↑ 1
;
follow-up:
↓ 4
@
16 years ago
- Milestone changed from Future Release to 3.0
Replying to wpmuguru:
Upload directories in multisite are determined by the UPLOADS & BLOGUPLOADSDIR constants. The only exception to that is if the original single WP content directory was wp-content/uploads.
Making the media upload handling more customizable internal to WP (it can be done with plugins) would definitely be an enhancement.
Please re-read the ticket. Thas to do with the main site, which from the code above is not using those constants. That's the point of ticket and why it's inconsistent.
#3
@
16 years ago
Hmm. I kinda like "thas" as an abbreviation for "this has." I might use it deliberately in the future. :)
#4
in reply to:
↑ 2
@
16 years ago
- Milestone changed from 3.0 to Future Release
Replying to filosofo:
Please re-read the ticket. Thas to do with the main site, which from the code above is not using those constants. That's the point of ticket and why it's inconsistent.
Please re-read my response: The only exception to that (UPLOADS & BLOGUPLOADSDIR) is if the original single WP content directory was wp-content/uploads.
If the upload_path option on the main site in a 3.0 network is not wp-content/uploads the constants are used. Try changing the upload_path to something other than wp-content/uploads in the edit site screen to verify.
#5
@
16 years ago
- Keywords reporter-feedback dev-feedback added
Can a few people with custom content directories & upgraded MU installs give the patch I'm attaching a run and let me know if it causes any issues?
#6
follow-up:
↓ 7
@
16 years ago
- Keywords changed from has-patch, reporter-feedback, dev-feedback to has-patch reporter-feedback dev-feedback
The blog_id bit shouldn't be necessary, is_main_site() defaults to $current_blog->blog_id.
#7
in reply to:
↑ 6
@
16 years ago
Replying to nacin:
The blog_id bit shouldn't be necessary, is_main_site() defaults to $current_blog->blog_id.
switch_to_blog() doesn't update the $current_blog object. For this use, we need to know if the switched blog is the main site.
#11
follow-up:
↓ 12
@
16 years ago
If this fix went into 3.0 RC3, then it had the WEIRD effect of breaking my uploads settings for my main site (which is site #3 and not #1).
I had to MANUALLY go into the MS backend and change Upload Path from blank to wp-content/blogs.dir/3/files and Upload Url Path to http://domain.com/files for it to work like it used to.
#12
in reply to:
↑ 11
@
16 years ago
Replying to Ipstenu:
If this fix went into 3.0 RC3, then it had the WEIRD effect of breaking my uploads settings for my main site (which is site #3 and not #1).
I had to MANUALLY go into the MS backend and change Upload Path from blank to wp-content/blogs.dir/3/files and Upload Url Path to http://domain.com/files for it to work like it used to.
That's a side affect of your install being one of the alpha & beta test installs. We made several fixes to this along the way between February and now. A new network install will have the correct option values.
Sites that are imported via SQL may need the option value added.
Upload directories in multisite are determined by the UPLOADS & BLOGUPLOADSDIR constants. The only exception to that is if the original single WP content directory was wp-content/uploads.
Making the media upload handling more customizable internal to WP (it can be done with plugins) would definitely be an enhancement.