Make WordPress Core

Opened 16 years ago

Closed 14 years ago

#15361 closed defect (bug) (duplicate)

wp_start_object_cache() should be called within blog switching methods instead of wp_cache_init()

Reported by: prettyboymp Owned by:
Priority: normal Milestone:
Component: Cache API Version:
Severity: normal Keywords:
Cc: Focuses:

Description

The switch_to_blog() and restore_current_blog() functions call wp_cache_init() directly, which causes the object cache instance to be recreated. These methods should instead be calling the wp_start_object_cache() method which correctly checks whether wp_cache_init() or wp_cache_reset() should be used.

Attachments (1)

16258.diff​ (682 bytes ) - added by prettyboymp 16 years ago.

Download all attachments as: .zip

Change History (15)

#1 @scribu
16 years ago

Related: #14992

#2 @scribu
16 years ago

  • Component General → Cache

#3 @prettyboymp
16 years ago

  • Cc mpretty@… added

#4 @nacin
16 years ago

  • Milestone Awaiting Review → 3.1

#5 @scribu
16 years ago

  • Resolution → fixed
  • Status new → closed

(In [16359]) Use wp_start_object_cache() in switch_to_blog(). Props prettyboymp. Fixes #15361

#6 @scribu
16 years ago

  • Summary w_start_object_cache() should be called within blog switching methods instead of wp_cache_init() → wp_start_object_cache() should be called within blog switching methods instead of wp_cache_init()

#7 @ryan
16 years ago

We don't really need to re-add global and non-persistent groups or do those file and function exists checks. Maybe switch_to_blog() should directly call wp_cache_reset() if it exists otherwise do wp_cache_init().

#8 @nacin
16 years ago

  • Resolution fixed
  • Status closed → reopened

#9 @Denis-de-Bernardy
16 years ago

Suggesting we revert the changeset, for this reason:

​http://core.trac.wordpress.org/ticket/14992#comment:7

#10 @ryan
16 years ago

(In [16597]) Revert [16359]. Deal with it in 3.2. see #15361

#11 @ryan
16 years ago

  • Milestone 3.1 → Future Release

#12 @simonwheatley
16 years ago

  • Cc simon@… added

#13 @willmot
16 years ago

  • Cc willmot added

#14 @nacin
14 years ago

  • Milestone Future Release
  • Resolution → duplicate
  • Status reopened → closed

I think this is mostly handled now by #21434.

Note: See TracTickets for help on using tickets.