Skip to content

A platform for community discussion. Free, open, simple.

FIX: Failed to detect existing category permalink

Gerhard Schlagerf3c76ad482d3
diff --git a/app/models/category.rb b/app/models/category.rb
index 5949b4a09f1..96c9a09ce3b 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -585,6 +585,7 @@ class Category < ActiveRecord::Base
url = +"#{Discourse.base_uri}/c"
url << "/#{parent_category.slug}" if parent_category_id
url << "/#{old_slug}"
+ url = Permalink.normalize_url(url)
if Permalink.where(url: url).exists?
Permalink.where(url: url).update_all(category_id: id)