From 02a38eebbb2886074eb867851f101fffd4f0f8e8 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 3 Aug 2015 18:30:26 +1000 Subject: [PATCH] correct logic in importer --- script/import_scripts/lithium.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/import_scripts/lithium.rb b/script/import_scripts/lithium.rb index 8f12331f8..4d7a84366 100644 --- a/script/import_scripts/lithium.rb +++ b/script/import_scripts/lithium.rb @@ -763,7 +763,7 @@ SQL if l["href"] l["href"] = uri.path # we have an internal link, lets see if we can remap it? - permalink = Permalink.find_by_url(uri.path) + permalink = Permalink.find_by_url(uri.path) rescue nil if l["href"] && permalink && permalink.target_url l["href"] = permalink.target_url end @@ -774,12 +774,15 @@ SQL if upload_name png = UPLOAD_DIR + "/" + upload_name + ".png" jpg = UPLOAD_DIR + "/" + upload_name + ".jpg" + gif = UPLOAD_DIR + "/" + upload_name + ".gif" # check to see if we have it if File.exist?(png) image = png elsif File.exists?(jpg) image = jpg + elsif File.exists?(gif) + image = gif end end