Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
3.0.2, but probably also in 3.0.3
Actual behaviour:
When you try to update a question or guidance of a regular
non option based question in a published and customizable template, you'll see the following error in the
logs:
NoMethodError - undefined method `each_pair' for nil:NilClass:
app/controllers/org_admin/questions_controller.rb:262:in `update_option_ids'
app/controllers/org_admin/questions_controller.rb:155:in `update'
Cause of the error is that this line
calls update_option_ids, but the parameter question_options_attributes is nil.
It should probably only be called when applicable.
Steps to reproduce:
- go to your org_admin web interface
- customize a template
- publish your changes
- try to edit a question text or guidance text for a question that is NOT option based