# 用户资料“顶级分类”的 URL 对子分类有误

**URL:** https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790
**Category:** Bug
**Created:** [2018年八月2日 17:52 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790 "2018-08-02T17:52:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dnsmichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dnsmichi/32/379505_2.png) [@dnsmichi](https://meta.discourse.org/u/dnsmichi)
#### Post date: [2018年八月2日 17:52 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790/1 "2018-08-02T17:52:37Z")

</div>

One of our users reported that the top categories in the user profile generate a permission denied error for their links.

My analysis and investigation is below, from what I can see this is a new feature in git master. [add links to Top Categories on user summary page · discourse/discourse@8e5e7c6 · GitHub](https://github.com/discourse/discourse/commit/8e5e7c6b436e9a9722929f1b66abc9925ee7989c)

## Versions

Latest HEAD from today: [https://github.com/discourse/discourse/compare/1ca999fdb58558171166e0dfbe10e10b374d3e33...tests-passed](https://github.com/discourse/discourse/compare/1ca999fdb58558171166e0dfbe10e10b374d3e33...tests-passed)

## Steps to reproduce

- Navigate to a profile - Summary - Top Categories
- Pick a category which is a sub category to a main one

### Example

For example, my profile on [https://monitoring-portal.org/u/dnsmichi/summary](https://monitoring-portal.org/u/dnsmichi/summary) → “Icinga 2” is a sub category of “Icinga”.

 ![Auswahl_218](https://global.discourse-cdn.com/meta/original/3X/0/5/0542098f9b62ead087c7188b11b52cfc1b5221af.png)

The URL just contains the direct link but misses the `/icinga` in its path being the main category.

Wrong: `https://monitoring-portal.org/c/icinga-2`  
Correct: `https://monitoring-portal.org/c/icinga/icinga-2`

Thanks for looking into it, I honestly don’t understand the code 🙂

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2018年八月2日 17:56 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790/2 "2018-08-02T17:56:02Z")

</div>

@vinothkannans is it related to your recent work? If not I can give it a look by tomorrow.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [2018年八月2日 18:40 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790/3 "2018-08-02T18:40:17Z")

</div>

I worked on that so I can look.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [2018年八月2日 21:39 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790/5 "2018-08-02T21:39:27Z")

</div>

I pushed a fix for this.

---

<div class="post-metadata">

### Author: ![dnsmichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dnsmichi/32/379505_2.png) [@dnsmichi](https://meta.discourse.org/u/dnsmichi)
#### Post date: [2018年八月3日 06:36 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790/6 "2018-08-03T06:36:40Z")

</div>

Awesome, thank you. Upgraded now to latest and works like a charm ❤

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2018年八月3日 11:34 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790/7 "2018-08-03T11:34:14Z")

</div>


