instedd / mbuilder

Scalable SMS application builder
http://mbuilder.instedd.org/
6 stars 1 forks source link

Creating new from invalid CSV crashes site #272

Closed pmallol closed 9 years ago

pmallol commented 9 years ago

Found in version 1.2-pre1

  1. Open application and navigate to Data
  2. Create new data from CSV
  3. Select an invalid CSV (such as: https://drive.google.com/a/manas.com.ar/file/d/0BzOfkpS6LT6lQnZ6U2dZcWNCU3M/view?usp=sharing)
  4. Add a name and click the 'Import' button

Obtained: 500 server error page and error

CSV::MalformedCSVError (Missing or stray quote in line 2):
 app/models/tables/importer.rb:166:in `read_csv'
 app/models/tables/importer.rb:28:in `save_csv'
 app/controllers/tables_controller.rb:9:in `upload'

Expected: a notice appears indicating the CSV is invalid and that the importing failed or the app shows which rows/columns are invalid and lets the user change/delete them.

pmallol commented 9 years ago

Working ok in version 1.2-pre2, now a flash notice appears saying "The CSV file is blank or invalid".