Ticket #17054 (closed defect (bug): fixed)

Opened 11 months ago

Last modified 11 months ago

Multiple tag queries broken

Reported by: neoxx Owned by:
Priority: normal Milestone: 3.1.2
Component: Taxonomy Version: 3.1.1
Severity: normal Keywords: has-patch commit
Cc:

Description

Hi,

Since the update to 3.1.1 archive pages like /tag/tag1+tag2/ result in a 404. Could anybody verify this?

Tested with 3.1.1 and latest trunk w/ TwentyTen

Cheers, Berny

Attachments

17054.diff Download (536 bytes) - added by ryan 11 months ago.
17054.2.diff Download (540 bytes) - added by scribu 11 months ago.
Leave only 'NOT IN' check
unit-query-flags.php Download (7.5 KB) - added by scribu 11 months ago.
query flag unit tests

Change History

  • Keywords reporter-feedback added

We can't reproduce it. Have you tried deactivating all plugins?

Due to #16730, 3.1 would sometimes do an OR when it should have been doing an AND for these requests. tag1+tag2 is an intersection and tag1,tag2 is a union. Is an intersection (AND) what you are expecting from tag1+tag2?

3.1.1 doesn't set a queried object for tag1+tag2. 3.0 sets the queried object to tag1.

  • Version set to 3.1.1
  • Milestone changed from Awaiting Review to 3.1.2

3.1.1 doesn't set a queried object for tag1+tag2. 3.0 sets the queried object to tag1.

To clarify, 3.1 also did this.

ryan11 months ago

The is_* flags are not being set for AND queries. Patch fixes that.

Sorry, it took me a little bit as I was *unknowingly* using a child theme of TwentyTen which pretty much looked the same, except the index.php has been modified. And as far as I can tell, that's where my 404 came from:

Queries to /tag/tag1/ would be handled by the tag.php template while /tag/tag1+tag2/ (logical AND) would be redirected to index.php.

Anyway, Ryan's patch looks good to me on my machine. - Gonna test it on another system.

  • Keywords close added; reporter-feedback removed

yep, works as well.

thanks for the quick fix!

  • Keywords close removed

The close keyword is for recommending the resolution of a ticket, other than fixed (wontfix, invalid, etc.).

sorry. - still trying to keep with the latest changes to the trac workflows...

NOT requests seem unaffected. Neither 3.0 nor 3.1.1 set queried object or is_* flag for pure NOT/NOT IN requests.

  • Status changed from new to closed
  • Resolution set to fixed

(In [17606]) Set is_* flags for AND taxonomy queries. fixes #17054 for trunk

(In [17607]) Set is_* flags for AND taxonomy queries. fixes #17054 for 3.1

There is no 'NOT' operator for taxonomy queries. The only accepted ones are 'AND', 'IN' and 'NOT IN'.

Leave only 'NOT IN' check

query flag unit tests

  • Keywords has-patch commit added
  • Status changed from closed to reopened
  • Resolution fixed deleted

We really shouldn't leave this in. See 17054.2.diff Download.

I also wrote some unit tests for query flags, which would catch this bug if it sneaked up again. 50 tests so far.

See unit-query-flags.php Download.

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [17610]) There is not a NOT operator. Props scribu. fixes #17054 for trunk

(In [17611]) There is not a NOT operator. Props scribu. fixes #17054 for 3.1

Note: See TracTickets for help on using tickets.