fix for xls import for blank url and files descriptions
This commit is contained in:
parent
ec4f25170d
commit
b974cb771a
|
@ -87,9 +87,9 @@ module Admin::AnnouncementsHelper
|
|||
anns.text_translations = value
|
||||
value = {}
|
||||
when 16
|
||||
links = val.split(";")
|
||||
desc_en = row.cells[17].value.split(";")
|
||||
desc_zh_tw = row.cells[18].value.split(";")
|
||||
links = val.split(";") rescue []
|
||||
desc_en = row.cells[17].value.split(";") rescue []
|
||||
desc_zh_tw = row.cells[18].value.split(";") rescue []
|
||||
links.each_with_index do |link,i|
|
||||
bl = BulletinLink.new
|
||||
bl.url = link.strip
|
||||
|
@ -98,11 +98,11 @@ module Admin::AnnouncementsHelper
|
|||
bl.save
|
||||
end
|
||||
when 19
|
||||
files = val.split(";")
|
||||
desc_en = row.cells[20].value.split(";")
|
||||
desc_zh_tw = row.cells[21].value.split(";")
|
||||
alt_en = row.cells[22].value.split(";")
|
||||
alt_zh_tw = row.cells[23].value.split(";")
|
||||
files = val.split(";") rescue []
|
||||
desc_en = row.cells[20].value.split(";") rescue []
|
||||
desc_zh_tw = row.cells[21].value.split(";") rescue []
|
||||
alt_en = row.cells[22].value.split(";") rescue []
|
||||
alt_zh_tw = row.cells[23].value.split(";") rescue []
|
||||
files.each_with_index do |file, i|
|
||||
bf = BulletinFile.new
|
||||
bf.remote_file_url = file.strip rescue nil
|
||||
|
|
Loading…
Reference in New Issue