From d96ca0a98571231fc160c80435fe4b8313e25655 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 17 May 2016 17:43:46 -0400 Subject: [PATCH] FIX: vanilla_mysql importer shouldn't exit when creating duplicate permalink --- script/import_scripts/vanilla_mysql.rb | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/script/import_scripts/vanilla_mysql.rb b/script/import_scripts/vanilla_mysql.rb index b89aeff6993..aba0dd9423d 100644 --- a/script/import_scripts/vanilla_mysql.rb +++ b/script/import_scripts/vanilla_mysql.rb @@ -336,10 +336,7 @@ class ImportScripts::VanillaSQL < ImportScripts::Base User.find_each do |u| ucf = u.custom_fields if ucf && ucf["import_id"] && ucf["import_username"] - Permalink.create( - url: "profile/#{ucf['import_id']}/#{ucf['import_username']}", - external_url: "/users/#{u.username}" - ) + Permalink.create( url: "profile/#{ucf['import_id']}/#{ucf['import_username']}", external_url: "/users/#{u.username}" ) rescue nil end end @@ -350,15 +347,9 @@ class ImportScripts::VanillaSQL < ImportScripts::Base id = pcf["import_id"].split('#').last if post.post_number == 1 slug = Slug.for(topic.title) # probably matches what vanilla would do... - Permalink.create( - url: "discussion/#{id}/#{slug}", - topic_id: topic.id - ) + Permalink.create( url: "discussion/#{id}/#{slug}", topic_id: topic.id ) rescue nil else - Permalink.create( - url: "discussion/comment/#{id}", - post_id: post.id - ) + Permalink.create( url: "discussion/comment/#{id}", post_id: post.id ) rescue nil end end end