#16730 closed defect (bug) (fixed)
query_posts() problem with multiple tags since 3.1 update
Reported by: | joshstauffer | Owned by: | scribu |
---|---|---|---|
Milestone: | 3.1.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
When I upgraded to 3.1 this query stopped working.
Does NOT return any results in 3.1:
query_posts( 'cat=8&tag=featured+hotels-and-motels' );
Returns expected results in 3.1:
$args = array ( 'cat' => 8, 'tag_slug__and' => 'featured+hotels-and-motels', ); query_posts( $args );
Attachments (2)
Change History (20)
#4
@
14 years ago
Caused by [17272], which added back the old processing, but didn't skip the new, global, processing.
#6
@
14 years ago
I don't know if we can do it at this point, but having all taxonomies support '+' and ',' might be nice.
#7
@
14 years ago
Re doubling:
The trouble is that after each call to parse_query(), 'tag_slug__and'
and 'tag_slug__in'
are populated again, without being reset.
Two ways of going about this:
- Reset them using $wp_query->query. This is the easiest way, but is a potential source of future bugs.
- Don't manipulate them at all; parse 'cat' and 'tag' directly into tax_query.
#8
@
14 years ago
Actually, the first approach will cause bugs: say, if someone were to set 'category__and'
on 'pre_get_posts', so nevermind that.
#9
@
14 years ago
- Cc amir@… added
As per IRC convo confirming that the issue I reference here and in Support Forum is a related issue with failure of 'category__and'
since 3.1 update.
#12
@
14 years ago
- Resolution set to fixed
- Status changed from accepted to closed
So, for 'category', include_children is false. That's expected, since 'cat' is lame.
But, for 'post_tag', include_children is set to true. That shouldn't be.
#14
@
14 years ago
Nevermind that last comment; include_children is ignored unless the taxonomy is hierarchical.
#15
@
14 years ago
I resolved my issue by changing the query to use an Advanced Taxonomy Query. Details are on the support forum.
#18
@
14 years ago
Could we also get 16730.diff in?
3.1.1 for investigation.