Skip to content

Conversation

@rajpatel24
Copy link
Contributor

@rajpatel24 rajpatel24 commented Nov 6, 2025

Summary

This PR fixes the export error Mismatched labels and translations: [label] [None, big-image] 1!=2 which occurred when a form contained a big-image column.

Description

Previously, forms containing a big-image column failed during data export with the error Mismatched labels and translations: [some-label] [None, big-image] 1!=2.

This happened because pyxform defines the alias big-image → media::big-image, but our expand_content logic only recognized audio, image, and video as valid media types. As a result, big-image was not treated as a media field and was incorrectly appended to the translations array, leading to inconsistent translation counts and TranslationError exceptions during FormPack build or export.

This fix adds big-image to the MEDIA_COLUMN_NAMES constant and ensures expand_content dynamically references that list when parsing media columns. With this change, big-image is 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

  1. Download the form: [test_form.xlsx]
  2. Deploy the form and submit at least one response.
  3. [On PR/PR commit] try exporting the data, the export should complete successfully.
  4. [On main/main commit] try exporting the same data it fails with TranslationError: Mismatched labels and translations: [label] [None, big-image] 1!=2.

@rajpatel24 rajpatel24 self-assigned this Nov 6, 2025
@rajpatel24 rajpatel24 force-pushed the fix-mismatched-labels-and-translations-export-failure branch from 87d5a1c to 6abda2d Compare November 6, 2025 16:09
@coveralls
Copy link

coveralls commented Nov 6, 2025

Coverage Status

coverage: 86.674%. remained the same
when pulling 376224b on fix-mismatched-labels-and-translations-export-failure
into efddba5 on main.

@rajpatel24 rajpatel24 changed the title repair malformed media columns-WIP fix: handle big-image as valid media type to prevent translation mismatches in exports Nov 14, 2025
@rajpatel24 rajpatel24 marked this pull request as ready for review November 14, 2025 16:20
@rajpatel24 rajpatel24 requested a review from jnm November 21, 2025 13:18
Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rajpatel24 rajpatel24 merged commit f6d4792 into main Nov 24, 2025
1 check passed
rajpatel24 added a commit to kobotoolbox/kpi that referenced this pull request Nov 24, 2025
…V-1172 (#6476)

### 📣 Summary
Update KPI to use the latest Formpack release, which adds support for
`big-image` as a valid media type in export workflow.


### 📖 Description
This PR updates the formpack dependency hash in `requirements.in`,
`requirements.txt`, and `dev_requirements.txt` to use the commit from
[formpack#336](kobotoolbox/formpack#336). That
PR introduces support for `big-image` as a valid media type to prevent
translation mismatches in exports.
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.

4 participants