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

New non-text calculations output a missing-label warning #451

Closed
MartijnR opened this issue Jun 12, 2020 · 5 comments
Closed

New non-text calculations output a missing-label warning #451

MartijnR opened this issue Jun 12, 2020 · 5 comments

Comments

@MartijnR
Copy link
Contributor

MartijnR commented Jun 12, 2020

I think these warnings are no longer helpful, in the forthcoming release that includes non-text calculations.

Example:

type name label hint calculation
dateTime a     now()
integer b     1 div 1
note note Hello World    

XLSForm

Outputs (in latest master):

Warnings:
[row : 2] Question has no label: {'type': 'dateTime', 'name': 'a', 'bind': {'calculate': 'now()'}}
[row : 3] Question has no label: {'type': 'integer', 'name': 'b', 'bind': {'calculate': '1 div 1'}}

The warning remains helpful:

  • if the question has no value in the calculation column and has no dynamic default value, as in example below:
type name label hint
dateTime a    
integer b    
@MartijnR MartijnR changed the title new non-text calculations output a warning New non-text calculations output a missing-label warning Jun 12, 2020
@pbowen-oc
Copy link

The current error messages are preventing forms form being uploaded as expected. Since old-style calculate items are also required to have a calculation, this is preventing forms from having non-visible items with default values that can be utilized by other items on the form in their default value expressions. Note that default values expressions that reference calculated values don't seem to work since the calculations are not performed prior to the default value expressions being evaluated.

@MartijnR
Copy link
Contributor Author

Since old-style calculate items are also required to have a calculation

I added a separate issue for this: #454

Note that default values expressions that reference calculated values don't seem to work since the calculations are not performed prior to the default value expressions being evaluated.

Added a documentation issue for this: XLSForm/xlsform.github.io#204 Maybe one day we could show a warning in pyxform for this as that would be ideal.

@pbowen-oc
Copy link

@gushil - Can you work on this?

@MartijnR - Should the warning be based on not having a label or based on not having a label or hint? I thought it was permitted to have an item in the UI with no label if it had a hint?

@MartijnR
Copy link
Contributor Author

MartijnR commented Jul 16, 2020

Great, thanks!

Should the warning be based on not having a label or based on not having a label or hint? I thought it was permitted to have an item in the UI with no label if it had a hint?

Yes, that's right, that is permitted. I think that part of the logic in pyxform can remain unchanged. We just need to omit the warning(s) we currently have for missing label (and hint), if a dynamic default is present.

@gushil
Copy link
Contributor

gushil commented Jul 17, 2020

@pbowen-oc I'm working on this.
@MartijnR I've created PR #458 to address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants