[wp-trac] [WordPress Trac] #42691: WP_Term_Query get_terms generates invalid sql queries

WordPress Trac noreply at wordpress.org
Sat Nov 25 00:10:27 UTC 2017


#42691: WP_Term_Query get_terms generates invalid sql queries
--------------------------+------------------------------
 Reporter:  GM_Alex       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  4.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by boonebgorges):

 Hi @GM_Alex - Thanks for the ticket and for the patch.

 Can you walk through the steps needed to reproduce this? It's true that
 `get_term()` can return a null value, but in `WP_Term_Query`, the term IDs
 pulled from the database or from the cache should always correspond to an
 existing term (and thus `get_term()` should *not* return `null`). I assume
 that you are working with a corrupted cache, or a plugin is filtering the
 term functions in an inconsistent way. This doesn't mean it's not
 something we should fix, but I want to understand the conditions for the
 error before throwing a band-aid over it.

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


More information about the wp-trac mailing list