Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 3 years ago

#41815 closed defect (bug) (fixed)

switch_to_blog() docs incorrectly state that autoloaded options aren't switched

Reported by: jdgrimes Owned by: jeremyfelt
Priority: normal Milestone: 4.9
Component: Cache API Version: 3.5
Severity: normal Keywords: good-first-bug has-patch
Cc: Focuses: docs, multisite

Description

The inline docs for switch_to_blog() include this:

 * Things that aren't switched:
 *  - autoloaded options. See #14992
 *  - plugins. See #14941

The statement that autoloaded options aren't switched was added to the docs in [15676], as suggested in 14992#comment:2. However, #14992 was later closed as worksforme, having been apparently fixed in the intervening time, via #21434 and other changes. The autoloaded options cache should now always be switched even when using a persistent caching plugin, since modern drop-ins should be implementing wp_cache_switch_to_blog().

As such, the statement that autoloaded options aren't switched doesn't appear to be accurate any longer, and should be removed. Or at the very least, it should be clarified to say that this is only a legacy issue with some persistent caching implementations.

Attachments (1)

41815.patch​ (443 bytes ) - added by stevepuddick 9 years ago.
line removed

Download all attachments as: .zip

Change History (8)

#1 @jdgrimes
9 years ago

  • Keywords good-first-bug added

@stevepuddick
9 years ago

line removed

#2 @stevepuddick
9 years ago

  • Keywords has-patch added

Here it is. Created as part of virtual contrib2core workshop. ​https://www.meetup.com/The-Ottawa-WordPress-Group/events/242253849/

#3 @jeremyfelt
9 years ago

  • Milestone Awaiting Review → 4.9
  • Owner set to jeremyfelt
  • Status new → reviewing

Good catch, as of [21403], the blog ID was added to the cache key for multisite installs.

Thanks for the patch @stevepuddick!

#4 @jeremyfelt
9 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 41373:

Multisite: Update docs for switch_to_blog().

As of [21403], autoload options are switched along with the cache key prefix.

Props stevepuddick.
Fixes #41815.

#6 @birgire
9 years ago

@pbearne great to see a video of the patch coding, thanks for sharing

#7 @audrasjb
3 years ago

In 57596:

Networks and Sites: Improve switch_to_blog() docblock.

Follow-up to [41373].

Props sabernhardt, jeremyfelt, audrasjb.
Fixes #60332.
See #41815.

Note: See TracTickets for help on using tickets.