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: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.8 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Networks and Sites | Keywords: | has-patch has-unit-tests |
| Focuses: | multisite | Cc: |
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 changed from Awaiting Review to 4.8
- Type changed from defect (bug) to 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 flixos90
- Status changed from new to assigned
#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.
Typos.