You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original title (see comments): Pagination for multiple tag pages not based on actual number of posts
yourblog.tld/tag/foo bar will show you the posts tagged with foo and bar, but the pagination will offer you more pages then there are actually, even more than one of the tags would have. For single tags, the pagination pages are correct.
When multiple tags are passed to Posts::get() as vocabulary parameter tags:all:term, as the tag page (act_display_tag) does, they are used in the JOIN statement that joins the term table in an ON ... IN (foo, bar, blablabla). An additional HAVING COUNT(*) = X filters the result so only the posts that have all terms are returned. Unfortunately, HAVING clauses are removed when COUNT is used in the SELECT statement (they would not work anyway). So we need to find a different way for either counts or vocabulary selections.
The text was updated successfully, but these errors were encountered:
Figured it out with @mikelietz that it's in the SQL: Tags are ORed (the term table is joined ON term IN (foo, bar, crap)) and then the posts are reduced with HAVING COUNT(*) = number of tags. That does not work for counts because HAVING clauses are removed for counts.
Original title (see comments): Pagination for multiple tag pages not based on actual number of posts
yourblog.tld/tag/foo bar
will show you the posts tagged with foo and bar, but the pagination will offer you more pages then there are actually, even more than one of the tags would have. For single tags, the pagination pages are correct.This is for both 0.9 and 0.10.
@mikelietz and I were able to work it out so far:
When multiple tags are passed to Posts::get() as vocabulary parameter
tags:all:term
, as the tag page (act_display_tag) does, they are used in the JOIN statement that joins the term table in anON ... IN (foo, bar, blablabla)
. An additionalHAVING COUNT(*) = X
filters the result so only the posts that have all terms are returned. Unfortunately, HAVING clauses are removed when COUNT is used in the SELECT statement (they would not work anyway). So we need to find a different way for either counts or vocabulary selections.The text was updated successfully, but these errors were encountered: