Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#17054 closed defect (bug) (fixed)

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 (3)

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

Download all attachments as: .zip

Change History (20)

  • Keywords reporter-feedback added

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

comment:2   ryan2 years ago

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?

comment:3   ryan2 years ago

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

comment:4   ryan2 years ago

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

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.

ryan2 years ago

comment:6   ryan2 years 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.

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

(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'.

scribu2 years ago

Leave only 'NOT IN' check

scribu2 years ago

query flag unit tests

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

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

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.

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

(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.