Make WordPress Core

Opened 8 years ago

Last modified 8 years ago

#46440 new defect (bug)

WP_Roles data doesn't load correctly when 'switch_to_blog' is called in a multisite.

Reported by: syammohanm Owned by:
Priority: normal Milestone: Awaiting Review
Component: Role/Capability Version: 5.1
Severity: normal Keywords:
Cc: Focuses: multisite

Description

On switch_to_blog call, eventually it will come to get_roles_data method of WP_Roles through switch_blog hook. Then this method checks is_multisite() && $this->site_id != get_current_blog_id(), but $this->site_id != get_current_blog_id() will always be false, because the current blog id is already set in switch_to_blog, hence it fails to load the data.

Change History (2)

#1 @jeremyfelt
8 years ago

  • Focuses multisite added

Thanks for the ticket, @syammohanm! I haven't taken a close look yet, but I'll add some tags that may help with visibility.

Related: #38645, #36961.

This ticket was mentioned in ​Slack in #core-multisite by jeremyfelt. ​View the logs.


8 years ago

Note: See TracTickets for help on using tickets.