Skip to content

767: accept yes/no aliases for auto_send/delete, tidy bool settings - #874

Open
lindsay-stevens wants to merge 1 commit into
XLSForm:masterfrom
lindsay-stevens:pyxform-767
Open

lindsay-stevens wants to merge 1 commit into
XLSForm:masterfrom
lindsay-stevens:pyxform-767

Conversation

@lindsay-stevens

@lindsay-stevens lindsay-stevens commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #767

Why is this the best possible solution? Were any other approaches considered?

Implements the ticket request, adds some clean-up for similar and related settings, adds test coverage. Considered extending existing processing inside xls2json but this improves consistency.

What are the regression risks?

Minor behaviour change, in that auto_send and auto_delete used to output the corresponding orx:auto-send and orx:auto-delete attributes with false if the user explicitly set it to false. Now these behave like client_editable and only appear when the setting is active, which appears consistent with the ODK spec.

A warning is added if the supplied value for a bool setting did not resolve to a yes/no/true/false alias, so that users are aware that an alternative default was used instead. No warning for missing/blank settings.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Maybe - auto_send/delete are documented, but they don't appear in the XLSForm template so it might be useful to add there.

Before submitting this PR, please make sure you have:

  • included test cases for core behavior and edge cases in tests
  • run python -m unittest and verified all tests pass
  • run ruff format pyxform tests and ruff check pyxform tests to lint code
  • verified that any code or assets from external sources are properly credited in comments

- collect bool settings uses of aliases.yes_no into new resolver func
  so that they are processed in one step in the same way.
- add a warning if any such settings value didn't resolve and so the
  default is used instead.
- convert older test_settings_auto_send_delete.py to use xpath style
- split existing client_editable tests into 4 test methods, and use the
  same pattern for auto_send/delete (total 12 tests).
- update behaviour of auto_send/delete to match client_editable (and
  the "incremental" parameter, probably others) where the attribute is
  only emitted if active. This is consistent with the ODK spec, where
  client behaviour only changes if the setting is active ("true").
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

Successfully merging this pull request may close these issues.

Accept standard true/false aliases for auto_send and auto_delete

1 participant