[wp-trac] [WordPress Trac] #5718: add_post_meta sets incorrect cache

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 25 01:52:36 GMT 2008


#5718: add_post_meta sets incorrect cache
------------------------+---------------------------------------------------
 Reporter:  nbachiyski  |       Owner:  anonymous      
     Type:  defect      |      Status:  new            
 Priority:  normal      |   Milestone:  2.5            
Component:  General     |     Version:                 
 Severity:  normal      |    Keywords:  cache has-patch
------------------------+---------------------------------------------------
 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.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5718>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list