Ticket #5248 (reopened defect (bug))

Opened 4 years ago

Last modified 15 months ago

Missing dot in query.php, category exclusion problem

Reported by: jaroche Owned by: westi
Priority: low Milestone: Future Release
Component: Query Version: 2.3
Severity: normal Keywords: needs-testing has-patch
Cc: jaroche

Description

I found that there's a missing dot when assigns the value to $whichcat in query.php, this interferes with the categories exclusion (generated with $q['category__not_in'] ).

Attachments

query-patch.php Download (721 bytes) - added by jaroche 4 years ago.
query-path.php Download (728 bytes) - added by jaroche 4 years ago.
5248.diff Download (992 bytes) - added by westi 4 years ago.
Patch against trunk
13682.diff Download (1001 bytes) - added by jaroche 2 years ago.
Patch against /trunk

Change History

jaroche4 years ago

jaroche4 years ago

westi4 years ago

Patch against trunk

  • Keywords needs-testing has-patch added
  • Milestone changed from 2.3.1 to 2.4

I've updated the patch to catch another case of the same issue.

Needs testing though

Pushing to 2.4 as 2.3.1 is nearly out the door.

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

comment:3   ryan4 years ago

Concatenation is purposefully left off in some place to avoid creating invalid queries. category_name and categorynot_in might work together but category_name and others will not.

  • Keywords reporter-feedback added

Has this been fixed by [6345] as that issue may have caused problems with these query vars?

  • Status changed from assigned to closed
  • Resolution set to invalid
  • Milestone 2.9 deleted

The lack of dot seems valid. Please re-open with a step by step test case to reproduce if it's still occurring.

jaroche2 years ago

Patch against /trunk

  • Cc jaroche added
  • Status changed from closed to reopened
  • Resolution invalid deleted

Hello,

I've updated the westi's patch for trunk. This fixes de bug for 2.9.2 and trunk.

To reproduce this bug:

  1. Create a single plugin that adds:
    $query->set('cat','-$categoryidtoexclude');
    
  2. Visit the category 'A' page (/category/a/) with posts categorized 'B', where category 'B' has been excluded.
  • Component changed from General to Query
  • Milestone set to 3.0
  • Keywords query reporter-feedback removed
  • Milestone changed from 3.0 to 3.1

You can also duplicate this with a url such as:

http://localhost/wordpress-commit/category/some-category/?cat=-1

Any posts in both will show, whereas you'd expect it to skip some.

However, I'm still going to push this out of 3.0 due to impending beta. I believe there are some other taxonomy query tickets which would be ideal to patch at the same time.

  • Milestone changed from Awaiting Triage to Future Release
Note: See TracTickets for help on using tickets.