WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 2 years ago

#28365 new defect (bug)

wp multisite, changed root blog has issues

Reported by: velegno Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5
Component: Networks and Sites Keywords: close
Focuses: multisite Cc:

Description

Hi,

Changing BLOG_ID_CURRENT_SITE has some issues:

  • It breaks the media paths of the new main blog. So for example I have a blog myblog4.mydomain.com with the id 4. The media path is wp-content/uploads/sites/4/ If I change BLOG_ID_CURRENT_SITE from 1 to 4 the media path becomes all of a sudden /wp-content/uploads. (!) This is not normal because I was just changing the main blog for my site, not the media path of that blog.
  • After changing the main blog, the new blogs created inherit some of the settings of the new blog, including, for example Upload Path. (if I remember correctly.) Anyhow there is an issue with new blogs.
  • At some point I got an infinite loop with the www subdomain and wp-sigup.php. However I think this bug is already solved.

And a whish for the wish list: Would it be possible to use a subdomain as the network site. I explain myself. I would like the www subdomain to behave like any other blog in the network. And I would like network.mydomain.com to be the actual network i.e. where wp-signup.php would land.

Please take a look to the following thread in the forum:

http://wordpress.org/support/topic/multisite-change-root-blog

Thanks

Change History (3)

#1 @SergeyBiryukov
3 years ago

I would like the www subdomain to behave like any other blog in the network.

That would be the exact opposite of #27927, so I guess it's not an option.

#2 @jeremyfelt
2 years ago

#33200 was marked as a duplicate.

#3 @jeremyfelt
2 years ago

  • Keywords close added
  • Version changed from 3.9.1 to 3.5

This one is tough. :)

  • [28123] turned off ms-files.php by default and introduced a lot of the current logic used to determine upload directory. At that point (3.5), changing BLOG_ID_CURRENT_SITE would result in the issue described in this ticket.
  • In 3.7, [25148] used the newly introduced is_main_network() to prevent the main sites on multiple networks from sharing the same wp-content/uploads/ directory.

To provide loose support for the change of a main network's main site ID, we could check for 1 == get_current_blog_id() rather than is_main_site(). The check now is really more about not breaking the initial uploads directory from the single site that existed before and not about enforcing a bare uploads/ directory for the main site.

That said, this is all pretty edge case and if we adjust the logic now we may suddenly break some configs that have worked around it over the last several years.

I lean toward wontfix as the upload_dir filter can be used to adjust the directory as needed.

Note: See TracTickets for help on using tickets.