Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot submit my questions of the c6 questionnaire in the questionnaire plugin while I can in the dataexplorer #6982

Closed
marikaris opened this issue Dec 5, 2017 · 2 comments

Comments

@marikaris
Copy link
Contributor

marikaris commented Dec 5, 2017

How to Reproduce

Import:
chr6 metadata

and:
chr6 data

Go to the questionnaire plugin, submit

Expected behavior

Item gets submit (as it does when switching status to submitted in dataexplorer and saving)

Observed behavior

screen shot 2017-12-05 at 09 43 58

@marikaris
Copy link
Contributor Author

marikaris commented Dec 6, 2017

Same thing happens sometimes when I push the save button for an already submitted row without changing anything.

screen shot 2017-12-06 at 08 08 03

@ConnorStroomberg
Copy link
Contributor

The problem seems to be that:

Form.submit -> triggers -> JqueryFrom.submit -> triggers -> Questionare.js.beforeSubmit

this checks the 'visibleExpression' and if this is false, sets the value to null ( this causes the backend error). The visible expression uses the 'age' function. this 'age' function use a form value to calculate the dateOfBirth however the input for this age function is a string "1982-05-05". The age function can not handle a string ( is expects a date) and returns 'NaN'. As 'NaN' is falsy the Questionare.js.beforeSubmit function sets the value to null.

To fix this we need to figure out why the date of birth is given as string instead of the expected date.

@ConnorStroomberg ConnorStroomberg self-assigned this Dec 6, 2017
marikaris added a commit that referenced this issue Dec 7, 2017
…-questionaire

Fix #6982 Translate date and dateTime values back into moments before…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants