[wp-trac] [WordPress Trac] #21459: Cleanup switch_to_blog() and restore_current_blog()

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 1 09:16:40 UTC 2012


#21459: Cleanup switch_to_blog() and restore_current_blog()
----------------------------+-----------------------
 Reporter:  ryan            |       Owner:  ryan
     Type:  task (blessed)  |      Status:  reopened
 Priority:  normal          |   Milestone:  3.5
Component:  Multisite       |     Version:  3.4.1
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+-----------------------
Changes (by joostdekeijzer):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 `$wp_roles->reinit()` calls `get_option` which uses `$wp_object_cache`, so
 it should be run after the cache object has been switched to the new
 blog_id. See attached patch.

 This actually also fixes the problem described in comment:26.

 I haven't been able to create a testcase to "prove" the issue, but I can
 attach a simple plugin which shows the problem, if needed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21459#comment:38>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list