User profile "top categories" URLs wrong for sub categories

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. https://github.com/discourse/discourse/commit/8e5e7c6b436e9a9722929f1b66abc9925ee7989c

Versions

Latest HEAD from today: 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 → “Icinga 2” is a sub category of “Icinga”.

Auswahl_218

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 :slight_smile:

5 Likes

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

I worked on that so I can look.

5 Likes

I pushed a fix for this.

9 Likes

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

2 Likes