You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifying a big-image for a choice option without a corresponding image does not result in an (expected) error, and will consequently generate an (invalid?) XForm where the choice option only has a big-image
Steps to reproduce the problem
Run pyxform on the BigImage_error2.xlsx form (below), and/or run it under current XLSForm Online
You will observe no error is reported, and a resulting XForm is generated.
Expected behavior
Expect an error, like "To use big-image, you must also specify an image for the choice option...", and no resulting XForm generated.
Background
Specifying a big-image media type in the main survey form without a corresponding image will (correctly) result in a fatal error:
"To use big-image, you must also specify an image for the survey element named {self.name}."
You can use this form to confirm this exsiting correct behavior when it is against a survey element: BigImage_error1.xlsx
However, no such check appears to be being made when you specify a big-image without an image for a choice option; no error is reported and pyxform will happily create a form with a big-image media type but no image for these options. This form will reproduce the problem: BigImage_error2.xlsx
Please note, this may be fixed with PR for #759, which has to include an almost identical check on choice options for the proposed new image-description form type, which also prerequisites having an image.
I expect to submit this PR shortly. But if you want to get a fix for this immediately then I am happy to share the associated code. I have test the PR against the above BigImage_error2.xlsx form and confirmed it fixes this issue too.
tiritea
changed the title
BUG: big-image without image does not throw error on choice option
big-image without image does not throw error on choice option
Feb 27, 2025
Software and hardware versions
pyxform 3.0.0 (and earlier)
Problem description
Specifying a big-image for a choice option without a corresponding image does not result in an (expected) error, and will consequently generate an (invalid?) XForm where the choice option only has a big-image
Steps to reproduce the problem
Run pyxform on the BigImage_error2.xlsx form (below), and/or run it under current XLSForm Online
You will observe no error is reported, and a resulting XForm is generated.
Expected behavior
Expect an error, like "To use big-image, you must also specify an image for the choice option...", and no resulting XForm generated.
Background
Specifying a big-image media type in the main survey form without a corresponding image will (correctly) result in a fatal error:
"To use big-image, you must also specify an image for the survey element named {self.name}."
You can use this form to confirm this exsiting correct behavior when it is against a survey element:
BigImage_error1.xlsx
However, no such check appears to be being made when you specify a big-image without an image for a choice option; no error is reported and pyxform will happily create a form with a big-image media type but no image for these options. This form will reproduce the problem:
BigImage_error2.xlsx
which generates a XML XForm with:
The text was updated successfully, but these errors were encountered: