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

Group named "data" causes Pyxform error about duplicate sections #91

Open
pbowen-oc opened this issue Jan 6, 2021 · 2 comments
Open
Assignees
Milestone

Comments

@pbowen-oc
Copy link

If I try to convert a form that has a group named "data", I get the following response:
Error: There are two sections with the name data.

Test form: Data1 version 2.zip

I am assuming this is due to Pyxform setting the root node as data now instead of using the XLS filename.

Is this error really intended? If so, can the message for this case be changed to something more suitable - i.e., indicating "data" is a reserved word and cannot be used for a group/repeating group name rather than telling the user there is a duplicate (that they can't see)? If this error can be avoided, that would be preferred since we already have forms with groups named data.

I noticed that having an item named data does not cause any errors in Pyxform or Validate. Is it safe to use that as an item name?

@pbowen-oc pbowen-oc added this to the Next milestone Jan 6, 2021
@MartijnR
Copy link
Member

MartijnR commented Jan 6, 2021

I don't think data is handled any differently as any other duplicate nodeName, but we can definitely do that.
Any old forms that use data but don't have that root node name, should not get any error message.

  • if duplicate node error is due to data being root, change to a more helpful message
  • look into question named data (and root node name data)

It's definitely safest to avoid duplicates because Enketo has been optimized knowing that pyxform has that rule. However, I think a single question named data (and a root named data) may be an acceptable risk though.

@MartijnR
Copy link
Member

MartijnR commented Jan 6, 2021

MartijnR added a commit that referenced this issue Jan 6, 2021
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

2 participants