-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Catch all errors when recomputing values in a field-list and show a helpful dialog #4750
Comments
It would be great to catch the exception and throw |
That sounds good to me. I've also filed a pyxform issue at XLSForm/pyxform#546 The Collect message could be something like Then the form should probably just close? It seems there's nothing of value that can be done with a form that has this kind of issue. |
The two first cases with calculates and selects turn out to be the same as opening a record for edit. That is, there has to be an attempt to bind the selected answer(s) to the available choices or we can’t open a record for edit. |
This form has a select minimal with a value that gets used in a calculate for another select that was previously filtered to have no choices. It causes this crash. Because the second select's choices have never been rendered, choices are not attached to the selection.
Somewhat related, this crash can be reproduced by having a calculate on a select that produces a value not related to the choices. e.g. I put "foobar" in the
calculate
for a select that did not include "foobar" in its choices.Also related to #4170.
People think they can use calculates as dynamic defaults. That will not work and they should not do that. In a way, it's not so bad that it crashes so catastrophically because at least they're not getting bad values which they would if the calculate succeeded. This can be fixed by adding a
trigger
. For example, in the sample form at top, add${select}
in the trigger column. That is how dynamic defaults are supposed to be expressed.Could we perhaps catch all of these and show a better error message suggesting there might be a misuse of calculates?
The text was updated successfully, but these errors were encountered: