Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 13 months ago

#41815 closed defect (bug) (fixed)

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

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

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 8 years ago.
line removed

Download all attachments as: .zip

Change History (8)

#1 @jdgrimes
8 years ago

  • Keywords good-first-bug added

@stevepuddick
8 years ago

line removed

#2 @stevepuddick
8 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
8 years ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to jeremyfelt
  • Status changed from new to 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
8 years ago

  • Resolution set to fixed
  • Status changed from reviewing to 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
8 years ago

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

#7 @audrasjb
13 months 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.