#16644 closed defect (bug) (fixed)
[15825] Changed the format of our category links from ?cat=123 to ?category_name=slug
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 3.1.1 |
| Component: | Permalinks | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | bigonroad |
Attachments (3)
Change History (22)
Replying to bigonroad:
When you say "no canonical redirects", do you mean one of the links doesn't work at all, or just that neither link is 301-ing to the other?
Both links work, no 301-ing takes place.
This comes back to the query_Var being set to category_name rather than 'cat' as you'd expect in this case.
The solution would be to change that var, however, I'm pretty sure we'll then also run into the fact that the rewrite rules are also based on that query variable.
comment:5
markjaquith — 2 years ago
dd32 — what do rewrite rules matter? This is for default permalinks — no rewrite rules are in play.
We need to move back to cat=. category_name= should still work and should probably canonically redirect.
- Keywords needs-patch added; has-patch needs-testing removed
Replying to nacin:
We need to move back to cat=. category_name= should still work and should probably canonically redirect.
Oops I thought ?cat= should redirect to ?category_name=
Replying to markjaquith:
dd32 — what do rewrite rules matter? This is for default permalinks — no rewrite rules are in play.
I was attempting to make the point of why the change has happened, That it's using the query_var specified in the register_taxonomy call, of whcih, is also utilised by the rewrite rule generation code, when you also look at the get_term_link code, it either uses the permastruct in use, or the query_var, Ie. The generated rewrite rules, as well as the non-rewrite rules rely on the same query var param
comment:10
dd32 — 2 years ago
get_term_link either needs a specific branch for categories in the non-rewrite context to use cat + id rather than category_name + slug (as all other taxonomy non-rewrite rules are)
comment:11
dd32 — 2 years ago
- Keywords has-patch added; needs-patch removed
attachment 16644.2.diff added
- modifies get_term_link to return ?cat= links.
comment:12
greuben — 2 years ago
attachment 16644.3.diff added
extended dd32's patch for canonical redirects
comment:13
ryan — 2 years ago
Per bug scrub, 16644.2.diff is the direction we want to go. We don't want to change canonical in a dot release. Let's test .2 and get it in.
comment:14
aaroncampbell — 2 years ago
I tested 16644.2.diff on a couple trunk installs and it works for me
comment:15
follow-up:
↓ 18
markjaquith — 2 years ago
greuben — can you open a ticket with category_name canonical redirect against future release? Just don't want that in 3.1.1
16644.2.diff is good. Going in.
comment:16
markjaquith — 2 years ago
- Resolution set to fixed
- Status changed from new to closed
comment:17
markjaquith — 2 years ago
comment:18
in reply to:
↑ 15
greuben — 2 years ago
Replying to markjaquith:
greuben — can you open a ticket with category_name canonical redirect against future release? Just don't want that in 3.1.1
comment:19
scribu — 2 years ago
?cat= doesn't include children after all, so get_term_link() will return URLs with different results, based on wether permalinks are turned on or not.
However:
(12:34:42 AM) rboren: That should return it whatever 3.0 did, yes? I don't care what it does as long it is what 3.0 does. :-) (12:35:16 AM) rboren: I need a drink to talk about taxonomy.
Alas, I don't have enough whiskey to make that change. :)

When you say "no canonical redirects", do you mean one of the links doesn't work at all, or just that neither link is 301-ing to the other?