mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 19:11:13 +00:00
86204fa4f0
This commit fixes the following scenario: 1. The user is searching for hashtags in chat, where the subcategory type is not highest-ranked in priority order. 2. There can, but doesn't have to be, a higher-ranked matching chat channel that has the same slug as the subcategory. 3. Since it is not the highest-ranked type, the subcategory, which normally has a ref of parent:child, has its ref changed to child::category, which does not work This was happening because whenever a hashtag type was not highest ranked, if _any_ other hashtag results conflicted slugs, we would append the ::type suffix. Now, we only append this suffix if a higher-ranked type conflicts with the hashtag, and we use the current ref to build the new typed ref to preserve this parent:child format as well, it's more accurate.