[wp-trac] [WordPress Trac] #35075: Comment cache ignores custom query vars

WordPress Trac noreply at wordpress.org
Thu Jan 7 16:29:01 UTC 2016


#35075: Comment cache ignores custom query vars
-----------------------------+--------------------------
 Reporter:  jason_the_adams  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  4.5
Component:  Comments         |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:  performance
-----------------------------+--------------------------

Comment (by boonebgorges):

 Replying to [comment:12 jason_the_adams]:
 > Replying to [comment:11 boonebgorges]:
 > > OK. It would also be nice to have unit tests demonstrating that the
 cache is sensitive to custom query vars.
 >
 > I went to write the test and, interestingly enough, I found an "inverse"
 test in tests/comment/query.php:
 test_comment_cache_key_should_ignore_custom_params which relates to
 #22400. I see that @wonderboymusic added the `wp_array_slice_assoc` in
 [28460].
 >
 > This tests asserts that only one query is performed when a custom
 query_var is introduced, when I would assert that there should be two.
 What's the protocol in this case? Should I modify/remove the existing
 test?

 This is why we have regression tests - to know when we are changing
 behavior :)

 In this case, we are changing the behavior on purpose. So we should change
 the test too.

 [28460] was related to @wonderboymusic's quest to eradicate the use of
 `extract()`. We can fix this in a way that won't reintroduce `extract()`.

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


More information about the wp-trac mailing list