Fix "mismatched labels and translations" export failure #4978
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.
Checklist
Description
Resolves a bug that affected multi-language forms using
select_one_from_file
orselect_multiple_from_file
Notes
This includes a fix to formpack that prevents the
file
column, created whenformpack.utils.expand_content.expand_content()
processesselect_*_from_file
questions, from being transformed intomedia::file
and treated as a translatable column, which it is not (!)Additionally, this change calls
formpack.utils.bugfix.repair_file_column_content_in_place()
to undo the damage to existingAsset.content
andAssetVersion.version_content
. This repair utility is invoked in two places:Asset
and all associatedAssetVersion
s whenkobo.apps.reports.report_data.build_formpack()
is called, which happens during report and export generation;Asset
content alone when a GET request is sent to the asset detail endpoint.Related issues
kobotoolbox/formpack#323 (fix upon which this PR depends)
kobotoolbox/formpack#322 (detailed explanation of problem)
kobotoolbox/formpack#321 (PR which introduced the bug)