WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 5 months ago

#23750 reopened enhancement

Uploads go into subdirectory install of WordPress

Reported by: jondavidjohn Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5.1
Component: Upload Keywords: close
Focuses: multisite Cc:
PR Number:

Description

In upgrading a few sites to WordPress 3.5 and then giving WordPress its own directory (wp/), we continually see the uploads end up in wp/wp-content/blogs.dir instead of wp-content/blogs.dir.

For the time being as a work around we have enabled a network wide plugin that consists of

function ms_upload_fix($uploads) {
	$uploads['path'] = str_replace('/wp/', '/', $uploads['path']);
	$uploads['basedir'] = str_replace('/wp/', '/', $uploads['basedir']);
	return $uploads;
}
add_filter('upload_dir', 'ms_upload_fix');

We do have WP_CONTENT_DIR defined and assume it should use this if set.

Change History (9)

#1 @bigdawggi
7 years ago

  • Cc matt@… added

#2 @SergeyBiryukov
7 years ago

  • Component changed from Upload to Multisite

#3 @nacin
7 years ago

There may very well be a bug here to fix, and I'd like to. That said:

  • blogs.dir is only supported for networks installed prior to 3.5.
  • Installing WordPress in a subdirectory is only supported for networks installed in 3.5 or later.

Shifting an older install to a subdirectory was never tested, at least not with blogs.dir, which would probably explain why this was missed.

#4 @Ipstenu
6 years ago

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

I'm not sure this IS a bug.

wp-content IS in /wp/wp-content right? I mean, you're running WP out of a sub directory. Unless you ALSO moved the wp-content folder (possible), it's in the right place.

Boldly #wontfix

#5 follow-up: @nacin
6 years ago

  • Priority changed from normal to low
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Type changed from defect (bug) to enhancement

Based on:

We do have WP_CONTENT_DIR defined and assume it should use this if set.

I'm going to assume that jondavidjohn has indeed excluded /wp/ from that.

I'm fine with "fixing" this (per my comment) but I will note that it's more or less an enhancement, to support blogs.dir + WordPress in a subdirectory.

#6 in reply to: ↑ 5 @jondavidjohn
6 years ago

Replying to nacin:

I'm fine with "fixing" this (per my comment) but I will note that it's more or less an enhancement, to support blogs.dir + WordPress in a subdirectory.

Agree, likely more trouble than it's worth at this point. As we have a workaround and are now aware of the issue.

Installing WordPress in a subdirectory is only supported for networks installed in 3.5 or later.

Understood.

#7 @jeremyfelt
6 years ago

  • Component changed from Multisite to Upload
  • Focuses multisite added

#8 @chriscct7
4 years ago

  • Priority changed from low to normal

#9 @afercia
4 years ago

  • Keywords close added; needs-patch removed

Two years from the last feedback and seems an extremely edge case. I'd propose to close this ticket :) @jeremyfelt any thoughts?

Note: See TracTickets for help on using tickets.