When importing commerce_products, the language property is not set. It is saved in the database as an empty string.
Products created in this way can lead to problems, for example when the language is used to determine the form entry language in inline_commerce_form.

It would make more sense to either default the language to LANGUAGE_NONE, or to add a configuration option to the field to set the language, or possibly to allow the import to target the language property.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chris@bootcampmedia’s picture

Here's a patch that unconditionally sets the language to LANGUAGE_NONE.

chris@bootcampmedia’s picture

FileSize
572 bytes

Sorry, ignore previous patch, that was the wrong file.

This is the one.

liupascal’s picture

The following patch based on #2 also exposes the language code in the feeds mapper list

liupascal’s picture

FileSize
998 bytes

Sorry wrong file in the previous commit.
Here is the file with the right name

liupascal’s picture

Fixed typo

shi99’s picture

Now that the Feeds module has a "Language" setting for Commerce Product processor, I have taken this patch and modified it to work with the language setting instead of making it LANGUAGE_NONE. This means on import the language field in the commerce_product would be set using this language setting chosen by the user.

This was needed to allow for product types to have translations with the entity translations module when they were imported with feeds

Here is the updated patch.
Please check it out and let me know if there are any issues.

Thanks.