Check entities version in form with entities from repeats #1638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes getodk/central#1427
Code pulled out of #1628
This PR rejects a form if it has multiple datasets declared AND an old entities version spec (not 2025.1.0 when we are adding entities from repeats). This was easy to do when multiple datasets (like, households and members) were mentioned, but harder to do when it was just one dataset that was in a repeat. At the time of parsing the form definition and having access to the entities spec version, we don't yet know if a dataset is in a repeat or not.
BUT if we expect that the forms with entities from repeats usually come through pyxform, and pyxform adds the jr:template block, then a form with one entity in a repeat WILL look like it has multiple datasets at the time that we're trying to double-check the version.
What has been done to verify that this works as intended?
Why is this the best possible solution? Were any other approaches considered?
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.
Before submitting this PR, please make sure you have:
make testand confirmed all checks still pass OR confirm CircleCI build passes