kobotoolbox / kpi

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
https://www.kobotoolbox.org
GNU Affero General Public License v3.0
133 stars 180 forks source link

Error "argument of type 'NoneType' is not iterable" when trying to preview forms #2175

Open mdestaubin opened 5 years ago

mdestaubin commented 5 years ago

Description

Receiving the error message "argument of type 'NoneType' is not iterable" when trying to preview an uploaded form with mismatched label columns in the survey and choices tab.

Example: label vs label:: English (en).

Steps to Reproduce

  1. Upload this sample form as new project - sampleform.xlsx
  2. Click on the preview form icon

Expected behavior

There should be a preview of the form shown

Actual behavior

All that is shown is the error message: "argument of type 'NoneType' is not iterable"

Additional details

The form preview works if both columns say either label or label::English (en). It's only when they're mismatched that the error occurs.

tinok commented 5 years ago

It seems it can also happen if there are unlabeled language columns (label or hint) in the form. E.g.

image

This form has matching label languages but fails with the same error. Hopefully this helps to debug the error.

joshuaberetta commented 3 years ago

Seems like this was possibly related to Enketo and is no longer an issue — one can preview and deploy without error. The form-builder does however complain:

Perhaps there should be some feedback outside of the form-builder or even fail to deploy if this is the case? Exports do seem to work fine though, even with the mismatched translation in the OP xlsform.

cc. @jnm