I was in a hurry.
The number of entities in the migrate_map_* table now matches with the CSV, but the elements with the same name have a same ID (destid1), so it's still not good.
E.g.:
sourceid1, sourceid2, destid1
packaging, 1-5kg, 568
weight, 1-5kg, 568
Ok, I figured it out. It works fine.
If bundle and bundle_key are not defined then it works dynamically, I just had to make the CSV source plugin look at the attribute when creating the mapping, not just the name: ids: [attribute, name]
So the updated YML:
source:
plugin: csv
path: 'modules/custom/my_module/files/product_attribute_values.csv'
header_offset: 0
ids: [attribute, name]
process:
attribute: attribute
name: name
attribute_value_id:
plugin: entity_lookup
entity_type: commerce_product_attribute_value
source: name
value_key: name
access_check: false
destination:
plugin: 'entity:commerce_product_attribute_value'
norbert-goco → created an issue.
I've created a patch for Drupal 11.
norbert-goco → created an issue.
norbert-goco → created an issue.
I modified the patch because when I added a country code field to the user and put it on the admin page, its value was in the value parameter, not in the country_code.
norbert-goco → created an issue.
norbert-goco → created an issue.
Thanks for the patch. Also works on Drupal core 9.5.11.
norbert-goco → created an issue.
norbert-goco → created an issue.