Opened 10 years ago
Closed 9 years ago
#38699 closed task (blessed) (fixed)
Site count incorrect when using wpmu_create_blog() from a different network
| Reported by: | johnjamesjacoby | Owned by: | flixos90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.8 |
| Component: | Networks and Sites | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | multisite |
Description (last modified by )
When using wpmu_create_blog() to create a site on a network ID other than the current, both networks end up with incorrect site counts. The current network gets +1, the other network ID remains the same.
In the event this site is the first site in a new network, no site or user counts are saved in wp_sitemeta.
This is because of a fleet of functions that do not accept a network ID as a parameter. It's also due to a lack of a network "switching" API to flip the $current_site global around when calling them.
The following functions lack proper Network attribution:
wp_maybe_update_network_site_counts()wp_maybe_update_network_user_counts()wp_update_network_counts()wp_update_network_user_counts()wp_update_network_site_counts()
See: #37528.
Attachments (1)
Change History (16)
#2
@
9 years ago
- Keywords 2nd-opinion removed
- Milestone Awaiting Review → 4.8
- Type defect (bug) → task (blessed)
Let's make this a task to have a better overview on all the tickets that are part of this effort.
Done:
To-Do:
#3
@
9 years ago
- Owner set to
- Status new → assigned
After all of these tickets have been completed, we can fix the calls to use the appropriate network IDs to fix the original bug reported.
#7
@
9 years ago
I just opened #40489 in order to add the $network_id parameter to wp_is_large_network() as well. This is required in order to make the parameter work for wp_maybe_update_network_site_counts() and wp_maybe_update_network_user_counts().
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
9 years ago
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
9 years ago
#14
@
9 years ago
- Keywords has-patch has-unit-tests added
38699.diff ensures the site count is updated on the current network and also adds a unit test for it.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Typos.