From cacf99e144173367d6b7f19ab0ef1d52b44ba9f6 Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Wed, 30 Oct 2019 13:54:48 +0000 Subject: [PATCH] FIX: Generate category url correctly when slugs are empty --- app/models/category.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/category.rb b/app/models/category.rb index 74a6d87fb54..8c216ac6878 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -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