User profile "top categories" URLs wrong for sub categories


(Michael Friedrich) #1

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

Versions

Latest HEAD from today: Comparing 1ca999fdb58558171166e0dfbe10e10b374d3e33...tests-passed · discourse/discourse · GitHub

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 Monitoring Portal -> “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:


(Joffrey Jaffeux) #2

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


(Neil Lalonde) #3

I worked on that so I can look.


(Neil Lalonde) #5

I pushed a fix for this.


(Michael Friedrich) #6

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


(Régis Hanol) #7