Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#35251 closed defect (bug) (fixed)

'networks' should be global cache group

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by: dd32's profile dd32
Milestone: 4.4.2 Priority: normal
Severity: normal Version: 4.4
Component: Networks and Sites Keywords: needs-patch good-first-bug
Focuses: multisite Cc:

Description (last modified by johnjamesjacoby)

The networks cache group is currently being prefixed with a blog ID, making it a repeated cache miss and duplicating cached data when using multiple networks and querying for them between dashboards.

The backstory goes that WordPress 4.4 introduced the WP_Network class (see: #31985) and with it came a simple new method for getting a network, aptly titled get_instance(). This method is used in ms-settings.php and ms-load.php in place of some previously duplicated and uncached code, and is used to retrieve a network's details from the wp_sites database table. That query is wrapped in a new cache check with a new networks cache group, but this group was never added to the global cache groups array.

It's not a regression, but it could be slipped into 4.4.1 as it was an unintentional oversight that could cause cache corruption in multi-network setups.

Change History (8)

#1 @johnjamesjacoby
8 years ago

  • Description modified (diff)

#2 @spacedmonkey
8 years ago

This is a shame this didn't get into 4.4.1. This there any chance of getting it in the latest release?

#3 @dd32
8 years ago

  • Keywords needs-patch good-first-bug added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 4.4.2

Marking for 4.4.2 inclusion. This sounds like something that should just be dropped in.

#4 @dd32
8 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 36258:

Multisite: The networks group should be global.

Fixes #35251.

#5 @dd32
8 years ago

In 36259:

Multisite: The networks group should be global.

Merges [36258] to the 4.4 branch.
Fixes #35251.

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

8 years ago

#7 @ocean90
8 years ago

In 36411:

Multisite: Add the global cache group networks to restore_current_blog().

Missed in [36258].

See #35251.

#8 @ocean90
8 years ago

In 36412:

Multisite: Add the global cache group networks to restore_current_blog().

Merges [36411] to the 4.4 branch.
See #35251.

Note: See TracTickets for help on using tickets.