FIX: Generate category url correctly when slugs are empty

This commit is contained in:
Daniel Waterworth 2019-10-30 13:54:48 +00:00
parent 8d34f4bbd9
commit cacf99e144
1 changed files with 2 additions and 2 deletions

View File

@ -661,8 +661,8 @@ class Category < ActiveRecord::Base
url = @@url_cache[self.id]
unless url
url = +"#{Discourse.base_uri}/c"
url << "/#{parent_category.slug}" if parent_category_id
url << "/#{slug}"
url << "/#{parent_category.slug_for_url}" if parent_category_id
url << "/#{slug_for_url}"
@@url_cache[self.id] = -url
end