Opened 14 years ago
Closed 14 years ago
#14461 closed defect (bug) (fixed)
Consolidate `current_site_name` cache-key to `site_name`
Reported by: | benward | Owned by: | benward |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Multisite | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently—with object caching enabled (APC, in this case)—changing the name of the network in Super Admin: Options does not stick; the old name persists until the cache is cleared.
This is because the network named is retrieved from ms-load.php:get_current_site_name(), which pulls the network name from a ':current_site_name' cache key. However, the options (and all other instances) only save/invalidate the ':site_name' cache key. When you save Site Options, ':site_name' is updated and ':current_site_name' is not.
':current_site_name' is only used by the get_current_site_name() function. If ':current_site_name' is not set, the function pulls ':site_name' as the first fallback (also from the cache.) ':current_site_name' is therefore redundant, and maintains old data in the cache when options are saved.
This patch simply removes the ':current_site_name' cache lookup from get_current_site_name(), goes straight to ':site_name' instead, and in the event that it has to look-up from the database, caches ':site_name'.
Site Name appears to be the only affected field.
Patch to remove get/set of ':current_site_name' cache key and just use ':site_name' instead.