Opened 6 years ago
Last modified 3 years ago
#51779 new defect (bug)
wpdb->get_blog_prefix() doesn't allow wp_1_tablename structures
| Reported by: | MadtownLems | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Networks and Sites | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | multisite |
Description
Context: We have some OLD networks (10+ years, started as WPMU, etc)
In the process of dropping our Domain Mapping plugin for WordPress's native support, I encountered the following problem. Some (probably very few) old networks have the root site's tables as wp_1_options (instead of wp_options).
if ( defined( 'MULTISITE' ) && ( 0 === $blog_id || 1 === $blog_id ) ) {
return $this->base_prefix;
}
This logic explicitly prevents wp_1_options and friends as being queried, with requests to the root/base site going to wp_options (which doesn't exist).
Perhaps there could be some kind of sanity check that checks for the existence of tables with the prefix in this kind of situation?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi, @MadtownLems. It has been a while since you opened this issue. I'm wondering if you still have any sites where a potential fix could be testable?