Repository navigation
760: error when a choice has a big-image without an image - #888
Open
garthyoung45 wants to merge 1 commit into
Open
garthyoung45 wants to merge 1 commit into
garthyoung45 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ERwpXgC4Cq4J9dMUX2DA2K
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Garth · project thread
Closes #760
AI assistance: this change was written and tested with Claude Code (an AI coding agent). I have not reviewed it line by line as a pyxform expert would, so please review it with that in mind.
Why is this the best possible solution? Were any other approaches considered?
Survey elements already raise "To use big-image, you must also specify an image" in
SurveyElement.xml_label_and_hint. Choices never reach that code, so a choice with only abig-imageproduced an XForm with abig-imageform and noimage. The check is added tovalidate_choice_list, next to the existing name and label checks, so the error carries the choices sheet row number like the other choice errors. A newErrorCode.MEDIA_001holds the message.The check looks at whether the row has an
imageat all, the same rule the survey check uses. It does not compare per language.What are the regression risks?
A form that today converts with a choice
big-imageand noimagewill now fail with an error. That is the behaviour the issue asks for.Does this change require updates to documentation?
No.
Before submitting this PR, please make sure you have:
testspython -m unittestand verified all tests pass (locally 6test_xls2xform_convert__okcases withvalidate=Truefail with and without this change, because ODK Validate could not run in my environment)ruff format pyxform testsandruff check pyxform teststo lint code🤖 Generated with Claude Code
https://claude.ai/code/session_01ERwpXgC4Cq4J9dMUX2DA2K