[wp-trac] [WordPress Trac] #55837: WP_Term_Query cache problem

WordPress Trac noreply at wordpress.org
Mon Jul 4 23:15:57 UTC 2022


#55837: WP_Term_Query cache problem
-------------------------------------------------+-------------------------
 Reporter:  denishua                             |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.0.1
Component:  Taxonomy                             |     Version:  6.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests fixed-      |     Focuses:
  major                                          |
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 I was puzzled a bit by the `$wp_db_version` version bump. It looks like
 the intention was to [https://github.com/WordPress/wordpress-
 develop/pull/2756#pullrequestreview-996070109 clear the cache], and I see
 the `wp_cache_flush()` call in `update_core()`, but unless I'm missing
 something, it runs regardless of the `$wp_db_version` value, followed by
 [source:tags/6.0/src/wp-admin/includes/update-core.php?marks=1431#L1429
 some more code], none of which depends on `$wp_db_version`. So I'm curious
 why the version bump is needed :)

 If the DB version is bumped, `wp_cache_flush()` runs again in
 `wp_upgrade()` after schema upgrade, but since there's no actual schema
 upgrade here, it seems that for the purpose of the ticket, this second
 call would be redundant, as the one in `update_core()` should be enough.

 In a discussion with @peterwilsoncc it was determined that
 `$wp_db_version` should still be bumped for the `upgrade_600()` routine to
 run, as it was missed in [53011]. In that case, if it's not necessary for
 the cache clearing here, might be a good idea to do the bump separately,
 for clarity.

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


More information about the wp-trac mailing list