fix: handle big-image as valid media type to prevent translation mismatches in exports
#336
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.
Summary
This PR fixes the export error
Mismatched labels and translations: [label] [None, big-image] 1!=2which occurred when a form contained abig-imagecolumn.Description
Previously, forms containing a
big-imagecolumn failed during data export with the errorMismatched labels and translations: [some-label] [None, big-image] 1!=2.This happened because
pyxformdefines the aliasbig-image → media::big-image, but ourexpand_contentlogic only recognized audio, image, and video as valid media types. As a result,big-imagewas not treated as a media field and was incorrectly appended to thetranslationsarray, leading to inconsistent translation counts andTranslationErrorexceptions during FormPack build or export.This fix adds
big-imageto theMEDIA_COLUMN_NAMESconstant and ensuresexpand_contentdynamically references that list when parsing media columns. With this change,big-imageis correctly handled as a valid media type and is no longer added to the translations array preventing mismatched translation errors in exports.Steps to Reproduce
TranslationError: Mismatched labels and translations: [label] [None, big-image] 1!=2.