WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#33200 closed defect (bug) (duplicate)

Changing BLOG_ID_CURRENT_SITE breaks media

Reported by: gilbitron Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.3
Component: Media Keywords:
Focuses: multisite Cc:

Description

Say you upload media to the default site and a subsite while BLOG_ID_CURRENT_SITE is 1. The media locations are as follows:

  • Default site: uploads
  • Subsite: uploads/sites/2

When you change BLOG_ID_CURRENT_SITE to 2 the location of the media files changes so that it is now:

  • Default site: uploads/sites/1
  • Subsite: uploads

However no files are moved which results in broken media.

Change History (4)

#1 @ocean90
4 years ago

Related/Duplicate: #28365

What's the use case for changing BLOG_ID_CURRENT_SITE at a later date?

#2 @gilbitron
4 years ago

I'm not sure when someone would want to change their default site but I suppose it might happen. Regardless if you're going to allow the setting to be changed then it shouldn't break things.

#3 @wonderboymusic
4 years ago

While the naming convention is horrible, this is a semi-impossible situation for us to help you recover from in code. You will have to move the files yourself. Changing BLOG_ID_CURRENT_SITE is by hand a brute force tactic.

#4 @jeremyfelt
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the ticket, @gilbitron. I'm going to close this as a duplicate of #28365 as it deals with the location of media as well.

I'm not sure there's much we can do about it, but we can give it some thought.

Note: See TracTickets for help on using tickets.