[wp-trac] [WordPress Trac] #41867: wp_list_categories throws SQL error if list is empty

WordPress Trac noreply at wordpress.org
Fri Sep 15 12:28:39 UTC 2017


#41867: wp_list_categories throws SQL error if list is empty
-------------------------------+------------------------------
 Reporter:  firebird75         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Taxonomy           |     Version:  4.8.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by subrataemfluence):

 Hi, first of all thank you for your appreciation and of course driving me
 towards the Blackbox plugin! Its truly a handy debugging tool.

 As far as the query output is concerned, I am still unable to get it
 similar to yours, even with the only `movies_taxonomy` term (`ID = 16`)
 excluded (this term has post count 0).

 Here is the output in `Blackbox` console:


 {{{
 SELECT  t.*, tt.* FROM wp_terms AS t  INNER JOIN wp_term_taxonomy AS tt ON
 t.term_id = tt.term_id WHERE tt.taxonomy IN ('movies_taxonomy') AND
 t.term_id NOT IN (16) ORDER BY t.name ASC;
 }}}


 I have attached a screenshot.

 However, there are two differences I have in my query compared to yours:


 {{{
 1. 'taxonomy' => 'movies_taxonomy' (you have 'category')
 2. 'child_of' => 0
 }}}


 To my understanding, above will not make any difference in building the
 query, as the same function is being invoked. But if you think I am
 missing something or doing wrong, please help me with exact steps to
 follow.

 Thank you!

 Replying to [comment:4 firebird75]:
 > @subrataemfluence Here are the reasons :
 > - you replied very quickly
 > - you understood the issue
 > - you were able to quickly attempt reproducing it
 >
 > What else? :)

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


More information about the wp-trac mailing list