Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#24189 closed defect (bug) (fixed)

{$taxonomy}_relationships cache can easily become stale when a term is updated.

Reported by: westi's profile westi Owned by:
Milestone: 3.9 Priority: normal
Severity: major Version: 3.6
Component: Taxonomy Keywords: has-patch 3.7-early
Focuses: Cc:

Description

The {$taxonomy}_relationships cache stores the information about the terms associated with an object for a particular taxonomy.

If you update the term then we don't invalidate the cache and therefore a call to something like: get_the_terms() will return invalid data.

An example set of steps to reproduce (needs some form of persistent caching like memcache):

1) Create a new tag and assign it to a post
2) Use get_the_terms()
3) Edit the tag to change the description
4) Use get_the_terms() and find the old description is returned.

Very easy to reproduce in a unit-test.

Re-constituting the relationships cache for every object that is related to the term is probably going to be very expensive.

Maybe we should just switch to only caching IDs and then populating the term data from a different cache?

Attachments (1)

24189.diff (559 bytes) - added by westi 11 years ago.
Add a simple freshen of the term info during the get_object_term_cache call.

Download all attachments as: .zip

Change History (10)

#1 @westi
11 years ago

Added a test in [1272/tests]

@westi
11 years ago

Add a simple freshen of the term info during the get_object_term_cache call.

#2 @mintindeed
11 years ago

  • Cc gabriel.koen@… added

#4 @nacin
11 years ago

  • Keywords has-patch 3.7-early added
  • Milestone changed from 3.6 to Future Release
  • Priority changed from high to normal

Per IRC.

Version 0, edited 11 years ago by nacin (next)

#5 @wonderboymusic
11 years ago

  • Milestone changed from Future Release to 3.7

these are all marked 3.7-early

#6 @nacin
10 years ago

  • Milestone changed from 3.7 to Future Release

#7 @nacin
10 years ago

{$taxonomy}_children: #25711

#8 @wonderboymusic
10 years ago

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

Fixed in [27101].

#9 @wonderboymusic
10 years ago

  • Milestone changed from Future Release to 3.9
Note: See TracTickets for help on using tickets.