[wp-trac] [WordPress Trac] #23290: When using switch_to_blog() with a persistent object cache that lacks wp_cache_switch_to_blog() support, non-persistent groups are not maintained

WordPress Trac noreply at wordpress.org
Sat Feb 28 00:13:16 UTC 2026


#23290: When using switch_to_blog() with a persistent object cache that lacks
wp_cache_switch_to_blog() support, non-persistent groups are not maintained
-------------------------------------------------+-------------------------
 Reporter:  markjaquith                          |       Owner:
                                                 |  johnjamesjacoby
     Type:  defect (bug)                         |      Status:  closed
 Priority:  low                                  |   Milestone:  7.0
Component:  Cache API                            |     Version:  3.5
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing 2nd-opinion  |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by johnjamesjacoby):

 In [changeset:"61772" 61772]:
 {{{
 #!CommitTicketReference repository="" revision="61772"
 Cache API: Handle numerically-keyed `global_groups` when switching sites.

 This commit protects against another multisite cache edge-case where a
 persistent object-cache drop-in plugin (namely memcached) may use a
 numerically-keyed `global_groups` array instead of `'key' => true` like
 the default object-cache class, and includes the following changes:

 * Use `wp_is_numeric_array()` inside of
 `wp_cache_switch_to_blog_fallback()` so that the global group names array
 are always properly formatted regardless of the caching back-end in use
 * Add private helper methods to
 `Tests_Multisite_WpCacheSwitchToBlogFallback` to properly format global
 group names, and tweak a few tests to make them more resilient to
 different caching back-ends

 Follow up to r61760.

 See #23290.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/23290#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list