Opened 6 years ago
Last modified 6 years ago
#44630 new defect (bug)
WP_Term_Query does not return all terms when 'number' and 'object_ids' are specified
Reported by: | ettoredn | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | critical | Version: | |
Component: | Taxonomy | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
When querying for taxonomy terms assigned to certain objects, WP_Term_Query's query is LIMIT'ed if the 'number' argument is specified. This introduces a problem similar to hierarchical taxonomies where results must not be limited in order to retrieve children. In particular, the issue arises because each term_taxonomy_id, or "(term, taxonomy) couple", has more than one relationship in wp_term_relationships thus more than 1 row could be returned for the same term_taxonomy_id.
It is worth to notice that in order to replicate the problem in the attached test, the 'order' argument must be set to DESC which is the opposite of WP_Term_Query's default.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
PHPUnit test