Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#5718 closed defect (bug) (fixed)

add_post_meta sets incorrect cache

Reported by: nbachiyski's profile nbachiyski Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: General Keywords: cache has-patch
Focuses: Cc:


Desired: after calling add_post_meta the post_meta cache should be either non-existant or correct.

Actual: if post_meta cache doesn't exist for this post, add_post_meta will put the added pair and set it as the new cache.

Steps to reproduce: call update_post_meta, which deletes the post_meta cache and then call add_post_meta. The cache won't contain the updated value, only the added one.

Proposed solution: the cleanest way is to make add_post_meta delete the cache, so that the next read operation will rebuild it. Patch attached.

As a side thought: probably we can make all these function just update the cache, so that it is rebuilt only once.

Attachments (1)

add_post_meta-cache-corruption.diff (803 bytes) - added by nbachiyski 16 years ago.

Download all attachments as: .zip

Change History (5)

#1 @ryan
16 years ago

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

(In [6654]) Clear post_meta cache upon change. Props nbachiyski. fixes #5718

#2 @rubys
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This change causes APE to fail with "Call to undefined function wp_delete_cache".

(I hope reopening the defect is the appropriate protocol for this type of thing, if not, please let me know)

#3 @rubys
16 years ago

  • Cc rubys added

#4 @ryan
16 years ago

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

Fixed by [6657]

Note: See TracTickets for help on using tickets.