[wp-trac] [WordPress Trac] #29859: get_terms on hierarchical taxonomy fails when 'fields' arg contains 'id=>name' OR 'id=>slug'

WordPress Trac noreply at wordpress.org
Mon Oct 6 20:44:05 UTC 2014


#29859: get_terms on hierarchical taxonomy fails when 'fields' arg contains
'id=>name' OR 'id=>slug'
-------------------------------------------------+-------------------------
 Reporter:  technical_mastermind                 |       Owner:
     Type:  defect (bug)                         |  boonebgorges
 Priority:  normal                               |      Status:  accepted
Component:  Taxonomy                             |   Milestone:  4.1
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-unit-tests has-patch reporter-   |  Resolution:
  feedback                                       |     Focuses:
-------------------------------------------------+-------------------------
Changes (by boonebgorges):

 * keywords:  has-unit-tests has-patch => has-unit-tests has-patch reporter-
     feedback


Comment:

 [attachment:29859.patch] breaks up technical_mastermind's tests so that
 only one assertion happens per test. (The duplicated setup code required
 by the split tests is a bit annoying, but it's important to ensure that
 the assertions are actually independent of one another. Separating them
 out also means that one test can fail while the rest continue to run.)

 Before going ahead with this fix: technical_mastermind, in your original
 post you mentioned that *4* of the tests fail without the fix to
 `get_terms()`. I'm only seeing two failures:
 `test_get_terms_hierarchical_tax_hide_empty_true_fields_idslug()` and
 `test_get_terms_hierarchical_tax_hide_empty_true_fields_idname()`. Your
 diagnosis of the problem - that the 'tt.count' column wasn't being
 selected when 'hierarchical=true' on hierarchical taxonomies - suggests
 that there should only be failures when 'hierarchical=true' *and*
 'hide_empty=true', since when 'hide_empty=false' the count value is never
 used. So, 2 seems like the correct number of failing tests. Can you
 clarify where your 4 is coming from?

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


More information about the wp-trac mailing list