Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2350659-6-commerce-product-language-empty.patch | 981 bytes | shi99 |
#6 | commerce-product-processor-language-setting.jpeg | 100.04 KB | shi99 |
#5 | commerce_feeds-default_language-23506593-5.patch | 1004 bytes | liupascal |
#4 | commerce_feeds-default_language-23506593-4.patch | 998 bytes | liupascal |
#2 | commerce_feeds-default-language-2350659-2.patch | 572 bytes | chris@bootcampmedia |
Comments
Comment #1
chris@bootcampmedia CreditAttribution: chris@bootcampmedia commentedHere's a patch that unconditionally sets the language to LANGUAGE_NONE.
Comment #2
chris@bootcampmedia CreditAttribution: chris@bootcampmedia commentedSorry, ignore previous patch, that was the wrong file.
This is the one.
Comment #3
liupascal CreditAttribution: liupascal commentedThe following patch based on #2 also exposes the language code in the feeds mapper list
Comment #4
liupascal CreditAttribution: liupascal commentedSorry wrong file in the previous commit.
Here is the file with the right name
Comment #5
liupascal CreditAttribution: liupascal commentedFixed typo
Comment #6
shi99 CreditAttribution: shi99 commentedNow 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.