since quite some time now I’m not able to edit any multiple choice surveys within the template. This kind of problem existed some time ago already but was somehow fixed and is now back. When try to edit a survey <awx_url>/#/templates/job_template/id/survey/edit?question_variable=RANDOM_VARIABLE I get a “Something went wrong” Error Message and “TypeError: n.default is undefined”
The logs of the container don’t show any logs of unhealthy behauvior.
FollowUp:
Since no logs from the container showed any error messages, we dig a bit deeper into debugging with the browser console.
Cause is that in the /static/js/screens/Template/Survey/SurveyQuestionForm.js:126 at
‘const defaults = Array.isArray(question.default)’ is not caught when no default is set. That’s why it gets terminated with TypeError: n.default is undefined.
Basically having no default in a question is breaking it. So you’re forced to edit the questions now via api to add a default for it to be able to edit via webgui again.
An if (typeof question.default !== ‘undefined’) or similar before (and possibly in other places that also rely on defaults) should solve the problem.
In line 117 default: question?.default ?? ‘’, only sets to ‘’ if the reference is null, but not for undefined.
thanks for reaching out on list. We think this merits an issue on our Github, https://github.com/ansible/awx/issues. If you could open an issue up on Github it will get tagged and integrated into our planning and workflow. All future work will be tracked there. Issues should include as much information as possible, including screenshots, log outputs, or any reproducers.