diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index fd4e57a9f..2205a1792 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -252,8 +252,8 @@ class Admin::ImportDataController < OrbitBackendController } end - @i = 0 if @pages.present? + @i=0 @pages.each do |b| get_variables_for_new @@ -266,20 +266,20 @@ class Admin::ImportDataController < OrbitBackendController @page.enabled_for= ["en", "zh_tw", ""] @page.is_published = false if b[:menu_title].blank? - @page.title = "No Title Present" - @page.name = "No Name Present" + @page.title = 'No Title Present' + @i += 1 + @page.name = "#{@i}Page" else + @i += 1 @page.title = b[:menu_title] - @page.name = b[:menu_title] + @page.name = "#{@i}Page" end if b[:content].blank? @page.content = "No Content Present" else @page.content = b[:content] end - @i += 1 - Rails.logger.info"@@@@@@@@@@@@@@@@@@@@@@@@"+@i.inspect - @page.save + @page.save! end else puts "No Page Data"