[wp-trac] [WordPress Trac] #57163: _prime_post_caches() doesn't account for primed posts without primed meta/terms

WordPress Trac noreply at wordpress.org
Tue Nov 29 20:27:45 UTC 2022


#57163: _prime_post_caches() doesn't account for primed posts without primed
meta/terms
-------------------------------------------------+-------------------------
 Reporter:  ocean90                              |       Owner:  ocean90
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1.2
Component:  Query                                |     Version:  6.1
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch commit has-unit-tests      |     Focuses:
  fixed-major                                    |  performance
-------------------------------------------------+-------------------------
Changes (by ocean90):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54894" 54894]:
 {{{
 #!CommitTicketReference repository="" revision="54894"
 Query: Account for primed post caches without primed post meta/term
 caches.

 In [54352] `update_post_caches()` was replaced by `_prime_post_caches()`
 to reduce excessive object cache calls. That's because
 `_prime_post_caches()` checks first if post IDs aren't already cached.
 Unfortunately this becomes an issue if a post itself is cached but not the
 meta/terms.
 To fix this regression, `_prime_post_caches()` now always calls
 `update_postmeta_cache()` and `update_object_term_cache()` depending on
 the arguments passed to it. Both functions internally check whether IDs
 are already cached so the fix from [54352] remains in place.

 Props peterwilsoncc, spacedmonkey, ocean90.
 Fixes #57163.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57163#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list