FIX: vanilla_mysql importer shouldn't exit when creating duplicate permalink
This commit is contained in:
parent
4ff03b3451
commit
d96ca0a985
|
@ -336,10 +336,7 @@ class ImportScripts::VanillaSQL < ImportScripts::Base
|
||||||
User.find_each do |u|
|
User.find_each do |u|
|
||||||
ucf = u.custom_fields
|
ucf = u.custom_fields
|
||||||
if ucf && ucf["import_id"] && ucf["import_username"]
|
if ucf && ucf["import_id"] && ucf["import_username"]
|
||||||
Permalink.create(
|
Permalink.create( url: "profile/#{ucf['import_id']}/#{ucf['import_username']}", external_url: "/users/#{u.username}" ) rescue nil
|
||||||
url: "profile/#{ucf['import_id']}/#{ucf['import_username']}",
|
|
||||||
external_url: "/users/#{u.username}"
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -350,15 +347,9 @@ class ImportScripts::VanillaSQL < ImportScripts::Base
|
||||||
id = pcf["import_id"].split('#').last
|
id = pcf["import_id"].split('#').last
|
||||||
if post.post_number == 1
|
if post.post_number == 1
|
||||||
slug = Slug.for(topic.title) # probably matches what vanilla would do...
|
slug = Slug.for(topic.title) # probably matches what vanilla would do...
|
||||||
Permalink.create(
|
Permalink.create( url: "discussion/#{id}/#{slug}", topic_id: topic.id ) rescue nil
|
||||||
url: "discussion/#{id}/#{slug}",
|
|
||||||
topic_id: topic.id
|
|
||||||
)
|
|
||||||
else
|
else
|
||||||
Permalink.create(
|
Permalink.create( url: "discussion/comment/#{id}", post_id: post.id ) rescue nil
|
||||||
url: "discussion/comment/#{id}",
|
|
||||||
post_id: post.id
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue