#19848 closed defect (bug) (invalid)
Function is_main_site uses $current_site->blog_id instead of $current_site->id
Reported by: | matslundberg | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3.1 |
Component: | Multisite | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description
The function is_main_site uses $current_site->blog_id to compare if current blog is main site, should instead use $current_site->id. The $current_site->blog_id is not defined. $current_site (from what I can tell) loaded from table wp_site, which doesn't contain any blog_id column.
This leads to issues when trying the registration form for MS sites. I get a redirection-loop for a MS installation.
Attachments (2)
Change History (9)
#3
@
13 years ago
- Keywords reporter-feedback added
$current_site->blog_id
is defined in wpmu_current_site()
and in ms-settings.php
:
http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/ms-load.php#L145
http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/ms-settings.php#L47
It's also used in several more places. If it's undefined in your case, I guess we should find the underlying problem. I've just checked wp-signup.php
on my install, and $current_site->blog_id
is defined there.
Could you describe the steps to reproduce the redirection loop on a clean install?
#4
@
13 years ago
This is normal when you upgrade from old WordPress MU installs (2.8.x) and do not update wp-config.php to bring it inline with new configurations.
If you defined BLOG_ID_CURRENT_SITE and SITE_ID_CURRENT_SITE in wp-config.php issue will go away.
Changed $current_blog->blog_id to $current_blog->id