A platform for community discussion. Free, open, simple.
DEV: Use correct method for creating slugs (#31273)
Gerhard Schlager9279487079cd
diff --git a/script/bulk_import/base.rb b/script/bulk_import/base.rbindex 097f56ef6e9..70e01022382 100644--- a/script/bulk_import/base.rb+++ b/script/bulk_import/base.rb@@ -1431,7 +1431,7 @@ class BulkImport::Basecategory[:name] = namecategory[:name_lower] = name_lower- category[:slug] ||= Slug.ascii_generator(name_lower)+ category[:slug] ||= Slug.for(name_lower, "") # TODO Ensure that slug doesn't exist yetcategory[:description] = (category[:description] || "").scrub.strip.presencecategory[:user_id] ||= Discourse::SYSTEM_USER_IDcategory[:read_restricted] = false if category[:read_restricted].nil?@@ -1476,7 +1476,7 @@ class BulkImport::Basetopic[:archetype] ||= Archetype.defaulttopic[:title] = topic[:title][0...255].scrub.striptopic[:fancy_title] ||= pre_fancy(topic[:title])- topic[:slug] ||= Slug.ascii_generator(topic[:title])+ topic[:slug] ||= Slug.for(topic[:title])topic[:user_id] ||= Discourse::SYSTEM_USER_IDtopic[:last_post_user_id] ||= topic[:user_id]topic[:category_id] ||= -1 if topic[:archetype] != Archetype.private_message@@ -1892,7 +1892,7 @@ class BulkImport::Base.scrub.strip.presence- chat_channel[:slug] ||= Slug.ascii_generator(chat_channel[:name])+ chat_channel[:slug] ||= Slug.for(chat_channel[:name], "") # TODO Ensure that slug isn't a duplicateendchat_channel[:description] = chat_channel[:description][0..500].scrub.strip if chat_channel[