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

Opened 6 years ago

Last modified 5 years ago

category_name query fails on category assigned parent category

Reported by: Kafkaesqui Owned by: ryan
Priority: normal Milestone:
Component: General Version: 2.0
Severity: normal Keywords: category_name query IIS bg|has-patch bg|commit
Cc:

Description

A query type of category_name is causing a 404 error for any category assigned to a parent. Setting category to no parent corrects this. This only appears to occur on IIS server. I cannot duplicate the issue elsewhere (i.e. on Apache).

Same problem reported by another user (with query_posts - category parent issue unverified at time of ticket submission):

 http://wordpress.org/support/topic/53272

Attachments

2161.diff Download (1.0 KB) - added by davidhouse 6 years ago.

Change History

comment:1   ryan6 years ago

Try with the full category hierarchy. "parent-cat/sub-cat" We should fallback to matching on just the subcat if the entire hierarchy does not match, but evidently that isn't working.

Using category_name=parent-cat/sub-cat worked. I agree about the fallback, but at least there's a workaround.

  • Keywords bg|has-patch added

Here's a patch for the workaround. Don't know how many bugs it'll cause, though.

comment:4   ryan6 years ago

  • Owner changed from anonymous to ryan
  • Keywords bg|commit added

Tentatively giving it bg|commit. If this breaks things don't tell anyone I wrote the patch ;)

comment:6   ryan6 years ago

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

(In [3385]) Fallback to matching the leaf category if the full path doesn't match. Props David House. fixes #2161

comment:7   ryan6 years ago

  • Milestone set to 2.0.1
  • Milestone 2.0.1 deleted

Milestone 2.0.1 deleted

Note: See TracTickets for help on using tickets.