CSV import does not import non translatable custom fields correctly
Describe the bug When doing a CSV import e.g. during an e2e test custom fields are not being imported correctly if they are not translatable. The customFields are being exported to the translated entity instead.
Check: https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/data-import/providers/import-parser/import-parser.ts#L401C20-L401C50
parsedCustomFields is being created and stored in the translation. customFields are never being assigned to parsedProduct .
const parsedProduct: ParsedProduct = {
assetPaths: parseStringArray(r.assets),
optionGroups,
facets,
translations,
};
To Reproduce Steps to reproduce the behavior:
- Create a CSV file with variant:customFieldName where customFieldName is a non-translatable custom field
- Import the CSV
- The custom field has a default value in the database
Expected behavior The field should be populated from the CSV file
Environment (please complete the following information):
- @vendure/core version: 2.1 (but the code looks the same on master)
- Nodejs version: 20
- Database (mysql/postgres etc): psotgres
Additional context I'd gladly create a PR for this issue.
This version 2.1.8 issue could be related as well: https://discord.com/channels/1100672177260478564/1222882518139801631/1222882518139801631 Unfortunately, I won't have time to look at issues with translations until begin of May.
The linked message is not related to the CSV import. There is also a pretty obvious fix I could create a PR for. Just wanted to create an issue before creating a Pull Request because this is how it's described in CONTRIBUTING.md.